Index: test/.copyright
===================================================================
--- test/.copyright	(revision 14)
+++ test/.copyright	(revision 14)
@@ -0,0 +1,23 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
Index: test/.copyright
===================================================================
--- test/.copyright	(revision 14)
+++ 	(revision )
@@ -1,23 +1,0 @@
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
Index: test/.srcmessage
===================================================================
--- test/.srcmessage	(revision 14)
+++ test/.srcmessage	(revision 14)
@@ -0,0 +1,1 @@
+// This file is part of XPLRA, a remote-access plugin for X-Plane
Index: test/.srcmessage
===================================================================
--- test/.srcmessage	(revision 14)
+++ 	(revision )
@@ -1,1 +1,0 @@
-// This file is part of XPLRA, a remote-access plugin for X-Plane
Index: test/Makefile.am
===================================================================
--- test/Makefile.am	(revision 31)
+++ test/Makefile.am	(revision 31)
@@ -0,0 +1,38 @@
+INCLUDES=-I $(top_srcdir)/src/client/c $(VSCPL_CFLAGS)
+
+LDADD=../src/client/c/hu/varadiistvan/xplra/libxplra.la
+if TARGET_API_WIN32
+AM_LDFLAGS=-static -static-libgcc -static-libstdc++
+endif
+
+noinst_PROGRAMS=ctest basictest basicctest multigettest multigetctest multisettest multisetctest
+
+ctest_SOURCES=ctest.c
+if TARGET_API_WIN32
+ctest_LDFLAGS=-lstdc++
+endif
+
+basictest_SOURCES=basictest.cc
+
+basicctest_SOURCES=basicctest.c
+if TARGET_API_WIN32
+basicctest_LDFLAGS=-lstdc++
+endif
+
+multigettest_SOURCES=multigettest.cc
+
+multigetctest_SOURCES=multigetctest.c
+if TARGET_API_WIN32
+multigetctest_LDFLAGS=-lstdc++
+endif
+
+multisettest_SOURCES=multisettest.cc
+
+multisetctest_SOURCES=multisetctest.c
+if TARGET_API_WIN32
+multisetctest_LDFLAGS=-lstdc++
+endif
+
+EXTRA_DIST=\
+        runpy.sh                \
+        basictest.py
Index: test/Makefile.am
===================================================================
--- test/Makefile.am	(revision 31)
+++ 	(revision )
@@ -1,38 +1,0 @@
-INCLUDES=-I $(top_srcdir)/src/client/c $(VSCPL_CFLAGS)
-
-LDADD=../src/client/c/hu/varadiistvan/xplra/libxplra.la
-if TARGET_API_WIN32
-AM_LDFLAGS=-static -static-libgcc -static-libstdc++
-endif
-
-noinst_PROGRAMS=ctest basictest basicctest multigettest multigetctest multisettest multisetctest
-
-ctest_SOURCES=ctest.c
-if TARGET_API_WIN32
-ctest_LDFLAGS=-lstdc++
-endif
-
-basictest_SOURCES=basictest.cc
-
-basicctest_SOURCES=basicctest.c
-if TARGET_API_WIN32
-basicctest_LDFLAGS=-lstdc++
-endif
-
-multigettest_SOURCES=multigettest.cc
-
-multigetctest_SOURCES=multigetctest.c
-if TARGET_API_WIN32
-multigetctest_LDFLAGS=-lstdc++
-endif
-
-multisettest_SOURCES=multisettest.cc
-
-multisetctest_SOURCES=multisetctest.c
-if TARGET_API_WIN32
-multisetctest_LDFLAGS=-lstdc++
-endif
-
-EXTRA_DIST=\
-        runpy.sh                \
-        basictest.py
Index: test/basicctest.c
===================================================================
--- test/basicctest.c	(revision 40)
+++ test/basicctest.c	(revision 40)
@@ -0,0 +1,412 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of XPLRA, a remote-access plugin for X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include <hu/varadiistvan/xplra/xplra.h>
+
+#include <stdio.h>
+#include <string.h>
+
+#ifdef _WIN32
+#include <windows.h>
+#else
+#include <unistd.h>
+#endif
+
+//------------------------------------------------------------------------------
+
+#ifdef _WIN32
+void _sleep(int ms)
+{
+    Sleep(ms);
+}
+#else
+void _sleep(int ms)
+{
+    usleep(ms*1000);
+}
+#endif
+
+
+//------------------------------------------------------------------------------
+
+int main()
+{
+    static const char* tailNum1 = "VAI";
+
+    int retval = 0;
+    const char* errorString = 0;
+
+    int xplaneVersion = 0;
+    int xplmVersion = 0;
+    int xplraVersion = 0;
+
+    int numEngines = 0;
+    float spoolTime = 0.0;
+    double latitude = 0.0, longitude = 0.0;
+    ssize_t length, i;
+    size_t length1, j;
+    uint8_t result[260];
+    uint8_t* result1 = 0;
+    int32_t result3[8];
+    int32_t* result4 = 0;
+    float result5[8];
+    float* result6 = 0;
+    float acfElevUp;
+    double localX;
+    float numBlades[8];
+    int32_t batteryArrayOn[8];
+    uint8_t tailNum[40];
+
+    printf("Connection to X-Plane...\n");
+    int connectionID = xplra_connect();
+
+    if (connectionID>=0) {
+        printf("Connected.\n\n");
+    } else {
+        printf("Connection failed.\n");
+        goto cleanup;
+    }
+
+    printf("Showing a message...\n");
+    if (xplra_show_message(connectionID, "[basictest] Starting tests", 5.0)<0) goto error;
+    printf("\n");
+
+    printf("Querying the versions...\n");
+    if (xplra_get_versions(connectionID, &xplaneVersion,
+                           &xplmVersion, &xplraVersion)<0) goto error;
+    printf("X-Plane version: %d, XPLM: %d, XPLRA: %03d\n\n",
+           xplaneVersion, xplmVersion, xplraVersion);
+
+    printf("Querying the number of the engines...\n");
+    if (xplra_get_int(&numEngines, connectionID,
+                      "sim/aircraft/engine/acf_num_engines")<0)
+    {
+        goto error;
+    }
+    printf("The number of engines: %d\n\n", numEngines);
+
+    printf("Querying an invalid dataref...\n");
+    if (xplra_get_int(&numEngines, connectionID,
+                      "sim/aircraft/engine/num_engines")==0) {
+        printf("\n>>>>>>>>>>>> Succeeded!!!!!!!!!!!!!!!!!!!!!!\n\n");
+    } else {
+        printf("Error occured: %s\n\n",
+               xplra_get_last_error_string(connectionID));
+        xplra_clear_last_error(connectionID);
+    }
+
+    printf("Querying the spool time of a jet engine...\n");
+    if (xplra_get_float(&spoolTime, connectionID,
+                        "sim/aircraft/engine/acf_spooltime_jet")<0)
+    {
+        goto error;
+    }
+    printf("The spool time: %f\n\n", spoolTime);
+
+    printf("Querying the spool time of a propeller...\n");
+    if (xplra_get_float(&spoolTime, connectionID,
+                        "sim/aircraft/engine/acf_spooltime_prop")<0)
+    {
+        goto error;
+    }
+    printf("The spool time: %f\n\n", spoolTime);
+
+    printf("Querying the coordinates...\n");
+    if (xplra_get_double(&latitude, connectionID,
+                         "sim/flightmodel/position/latitude")<0)
+    {
+        goto error;
+    }
+    if (xplra_get_double(&longitude, connectionID,
+                         "sim/flightmodel/position/longitude")<0)
+    {
+        goto error;
+    }
+    printf("The coordinates: %f, %f\n\n", latitude, longitude);
+
+    printf("Querying the aircraft's description as an array of a fixed size...\n");
+    length = xplra_get_byte_array(result, sizeof(result)/sizeof(result[0]),
+                                  0, connectionID,
+                                  "sim/aircraft/view/acf_descrip");
+    if (length<0) goto error;
+    printf("Got %zu bytes, as a string: '%s'\n\n", length, result);
+
+    printf("Querying the aircraft's description as a dynamically created array with an offset of 3...\n");
+    length1 = 0;
+    result1 = xplra_get_byte_array_new(&length1, 3, connectionID,
+                                       "sim/aircraft/view/acf_descrip");
+    if (result1==0) goto error;
+    printf("Got %zu bytes, as a string: '%s'\n\n", length1, result1);
+
+    printf("Querying the aircraft's engine types as an array of a fixed size...\n");
+    length = xplra_get_int_array(result3, sizeof(result3)/sizeof(result3[0]), 0,
+                                 connectionID, "sim/aircraft/prop/acf_en_type");
+
+    if (length<0) goto error;
+    printf("Got %zd values:", length);
+    for(i = 0; i<length; ++i) {
+        if (i>0) printf(",");
+        printf(" %d", result3[i]);
+    }
+    printf("\n\n");
+
+    printf("Querying the aircraft's engine types as a dynamically created array...\n");
+    length1 = 0;
+    result4 = xplra_get_int_array_new(&length1, 0, connectionID,
+                                      "sim/aircraft/prop/acf_en_type");
+    printf("Got %zu values:", length1);
+    for(j = 0; j<length1; ++j) {
+        if (j>0) printf(",");
+        printf(" %d", result4[j]);
+    }
+    printf("\n\n");
+
+    printf("Querying the aircraft's propeller direction as an array of a fixed size...\n");
+    length = xplra_get_float_array(result5, sizeof(result5)/sizeof(result5[0]),
+                                   0, connectionID,
+                                   "sim/aircraft/prop/acf_prop_dir");
+    printf("Got %zd values:", length);
+    for(i = 0; i<length; ++i) {
+        if (i>0) printf(",");
+        printf(" %f", result5[i]);
+    }
+    printf("\n\n");
+
+    printf("Querying the aircraft's propeller direction as a dynamically created array...\n");
+    length1 = 0;
+    result6 = xplra_get_float_array_new(&length1, 0, connectionID,
+                                        "sim/aircraft/prop/acf_prop_dir");
+    printf("Got %zu values:", length1);
+    for(j = 0; j<length1; ++j) {
+        if (j>0) printf(",");
+        printf(" %f", result6[j]);
+    }
+    printf("\n\n");
+
+    printf("Setting the number of the engines to %d...\n", numEngines + 1);
+    if (xplra_set_int(connectionID, "sim/aircraft/engine/acf_num_engines",
+                      numEngines + 1)<0)
+    {
+        goto error;
+    }
+    if (xplra_get_int(&numEngines, connectionID,
+                      "sim/aircraft/engine/acf_num_engines")<0)
+    {
+        goto error;
+    }
+    printf("The new number of engines: %d\n\n", numEngines);
+
+
+    if (xplra_get_float(&acfElevUp, connectionID,
+                        "sim/aircraft/controls/acf_elev_up")<0)
+    {
+        goto error;
+    }
+    printf("Setting the aircraft elevator up control from %f to %f...\n",
+           acfElevUp, acfElevUp + 15.0);
+    if (xplra_set_float(connectionID,
+                        "sim/aircraft/controls/acf_elev_up",
+                        acfElevUp + 15.0) < 0)
+    {
+        goto error;
+    }
+    if (xplra_get_float(&acfElevUp, connectionID,
+                        "sim/aircraft/controls/acf_elev_up")<0)
+    {
+        goto error;
+    }
+    printf("The aircraft elevator up control set to %f\n\n", acfElevUp);
+
+    if (xplra_get_double(&localX, connectionID,
+                         "sim/flightmodel/position/local_x")<0)
+    {
+        goto error;
+    }
+    printf("Setting the aircraft's local X-coordinate from %f to %f...\n",
+           localX, localX + 15.0);
+    if (xplra_set_double(connectionID, "sim/flightmodel/position/local_x",
+                         localX + 15.0)<0)
+    {
+        goto error;
+    }
+    if (xplra_get_double(&localX, connectionID,
+                         "sim/flightmodel/position/local_x")<0)
+    {
+        goto error;
+    }
+    printf("The aircraft's local X-coordinate set to %f\n\n", localX);
+
+    length = xplra_get_float_array(numBlades,
+                                   sizeof(numBlades)/sizeof(numBlades[0]), 0,
+                                   connectionID,
+                                   "sim/aircraft/prop/acf_num_blades");
+    if (length<0) goto error;
+
+    printf("Setting the number of blades\n    from:");
+    for(i = 0; i<length; ++i) {
+        if (i>0) printf(",");
+        printf(" %f", numBlades[i]);
+    }
+    printf("\n    to:");
+    for(i = 0; i<length; ++i) {
+        numBlades[i] += 2.5;
+        if (i>0) printf(",");
+        printf(" %f", numBlades[i]);
+    }
+    printf("\n");
+    if (xplra_set_float_array(connectionID,
+                              "sim/aircraft/prop/acf_num_blades",
+                              numBlades, length, 0)<0)
+    {
+        goto error;
+    }
+    length = xplra_get_float_array(numBlades,
+                                   sizeof(numBlades)/sizeof(numBlades[0]), 0,
+                                   connectionID,
+                                   "sim/aircraft/prop/acf_num_blades");
+    if (length<0) goto error;
+    printf("The result:");
+    for(i = 0; i<length; ++i) {
+        if (i>0) printf(",");
+        printf(" %f", numBlades[i]);
+    }
+    printf("\n\n");
+
+    length = xplra_get_int_array(batteryArrayOn,
+                                 sizeof(batteryArrayOn)/sizeof(batteryArrayOn[0]),
+                                 0, connectionID,
+                                 "sim/cockpit/electrical/battery_array_on");
+    if (length<0) goto error;
+    printf("Setting the batteries\n    from:");
+    for(i = 0; i<length; ++i) {
+        if (i>0) printf(",");
+        printf(" %d", batteryArrayOn[i]);
+    }
+    printf("\n    to:");
+    for(i = 0; i<length; ++i) {
+        batteryArrayOn[i] = !batteryArrayOn[i];
+        numBlades[i] += 2.5;
+        if (i>0) printf(",");
+        printf(" %d", batteryArrayOn[i]);
+    }
+    printf("\n");
+    if (xplra_set_int_array(connectionID,
+                            "sim/cockpit/electrical/battery_array_on",
+                            batteryArrayOn, length, 0)<0)
+    {
+        goto error;
+    }
+    length = xplra_get_int_array(batteryArrayOn,
+                                 sizeof(batteryArrayOn)/sizeof(batteryArrayOn[0]),
+                                 0, connectionID,
+                                 "sim/cockpit/electrical/battery_array_on");
+    if (length<0) goto error;
+    printf("The result:");
+    for(i = 0; i<length; ++i) {
+        if (i>0) printf(",");
+        printf(" %d", batteryArrayOn[i]);
+    }
+    printf("\n\n");
+
+    memset(tailNum, 0, sizeof(tailNum));
+    strcpy((char*)tailNum, "HA-VAI");
+    printf("Setting the tail number to %s as a byte array...\n", tailNum);
+    if (xplra_set_byte_array(connectionID,
+                             "sim/aircraft/view/acf_tailnum",
+                             tailNum, sizeof(tailNum), 0)<0)
+    {
+        goto error;
+    }
+
+    memset(tailNum, 0, sizeof(tailNum));
+    length = xplra_get_byte_array(tailNum, sizeof(tailNum), 0,
+                                  connectionID,
+                                  "sim/aircraft/view/acf_tailnum");
+    if (length<0) goto error;
+    printf("The tail number is: '%s'\n\n", (char*)tailNum);
+
+    printf("Setting the tail number to %s as a string...\n", tailNum1);
+    if (xplra_set_string(connectionID, "sim/aircraft/view/acf_tailnum",
+                         tailNum1, 40, 0)<0)
+    {
+        goto error;
+    }
+    memset(tailNum, 0, sizeof(tailNum));
+    length = xplra_get_byte_array(tailNum, sizeof(tailNum), 0,
+                                  connectionID,
+                                  "sim/aircraft/view/acf_tailnum");
+    if (length<0) goto error;
+    printf("The tail number is: '%s'\n\n", (char*)tailNum);
+
+    printf("Preparing for the message tests, sleeping for 5 seconds...\n");
+    _sleep(5*1000);
+
+    printf("Showing a message for 10 seconds...\n");
+    if (xplra_show_message(connectionID, "[basictest] this message appears for 10 seconds", 10.0)<0) {
+        goto error;
+    }
+
+    printf("Sleeping for 3 seconds...\n");
+    _sleep(3*1000);
+
+    printf("Showing another message interrupting the previous one for 3 seconds");
+    if (xplra_show_message(connectionID, "[basictest] but this message interrupts it, and is displayed for 3 seconds", 3.0)<0) {
+        goto error;
+    }
+
+    printf("Sleeping for 5 seconds...\n");
+    _sleep(5*1000);
+    if (xplra_show_message(connectionID, "[basictest] and the tests come to an end!", 5.0)<0) {
+        goto error;
+    }
+
+    goto cleanup;
+error:
+    errorString = xplra_get_last_error_string(connectionID);
+    if (errorString==0) {
+        printf("\nUnknown error occured!\n");
+    } else {
+        printf("\nError: %s\n", errorString);
+    }
+
+    retval = 1;
+
+cleanup:
+    if (connectionID>=0) xplra_disconnect(connectionID);
+    return retval;
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: test/basicctest.c
===================================================================
--- test/basicctest.c	(revision 40)
+++ 	(revision )
@@ -1,412 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of XPLRA, a remote-access plugin for X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include <hu/varadiistvan/xplra/xplra.h>
-
-#include <stdio.h>
-#include <string.h>
-
-#ifdef _WIN32
-#include <windows.h>
-#else
-#include <unistd.h>
-#endif
-
-//------------------------------------------------------------------------------
-
-#ifdef _WIN32
-void _sleep(int ms)
-{
-    Sleep(ms);
-}
-#else
-void _sleep(int ms)
-{
-    usleep(ms*1000);
-}
-#endif
-
-
-//------------------------------------------------------------------------------
-
-int main()
-{
-    static const char* tailNum1 = "VAI";
-
-    int retval = 0;
-    const char* errorString = 0;
-
-    int xplaneVersion = 0;
-    int xplmVersion = 0;
-    int xplraVersion = 0;
-
-    int numEngines = 0;
-    float spoolTime = 0.0;
-    double latitude = 0.0, longitude = 0.0;
-    ssize_t length, i;
-    size_t length1, j;
-    uint8_t result[260];
-    uint8_t* result1 = 0;
-    int32_t result3[8];
-    int32_t* result4 = 0;
-    float result5[8];
-    float* result6 = 0;
-    float acfElevUp;
-    double localX;
-    float numBlades[8];
-    int32_t batteryArrayOn[8];
-    uint8_t tailNum[40];
-
-    printf("Connection to X-Plane...\n");
-    int connectionID = xplra_connect();
-
-    if (connectionID>=0) {
-        printf("Connected.\n\n");
-    } else {
-        printf("Connection failed.\n");
-        goto cleanup;
-    }
-
-    printf("Showing a message...\n");
-    if (xplra_show_message(connectionID, "[basictest] Starting tests", 5.0)<0) goto error;
-    printf("\n");
-
-    printf("Querying the versions...\n");
-    if (xplra_get_versions(connectionID, &xplaneVersion,
-                           &xplmVersion, &xplraVersion)<0) goto error;
-    printf("X-Plane version: %d, XPLM: %d, XPLRA: %03d\n\n",
-           xplaneVersion, xplmVersion, xplraVersion);
-
-    printf("Querying the number of the engines...\n");
-    if (xplra_get_int(&numEngines, connectionID,
-                      "sim/aircraft/engine/acf_num_engines")<0)
-    {
-        goto error;
-    }
-    printf("The number of engines: %d\n\n", numEngines);
-
-    printf("Querying an invalid dataref...\n");
-    if (xplra_get_int(&numEngines, connectionID,
-                      "sim/aircraft/engine/num_engines")==0) {
-        printf("\n>>>>>>>>>>>> Succeeded!!!!!!!!!!!!!!!!!!!!!!\n\n");
-    } else {
-        printf("Error occured: %s\n\n",
-               xplra_get_last_error_string(connectionID));
-        xplra_clear_last_error(connectionID);
-    }
-
-    printf("Querying the spool time of a jet engine...\n");
-    if (xplra_get_float(&spoolTime, connectionID,
-                        "sim/aircraft/engine/acf_spooltime_jet")<0)
-    {
-        goto error;
-    }
-    printf("The spool time: %f\n\n", spoolTime);
-
-    printf("Querying the spool time of a propeller...\n");
-    if (xplra_get_float(&spoolTime, connectionID,
-                        "sim/aircraft/engine/acf_spooltime_prop")<0)
-    {
-        goto error;
-    }
-    printf("The spool time: %f\n\n", spoolTime);
-
-    printf("Querying the coordinates...\n");
-    if (xplra_get_double(&latitude, connectionID,
-                         "sim/flightmodel/position/latitude")<0)
-    {
-        goto error;
-    }
-    if (xplra_get_double(&longitude, connectionID,
-                         "sim/flightmodel/position/longitude")<0)
-    {
-        goto error;
-    }
-    printf("The coordinates: %f, %f\n\n", latitude, longitude);
-
-    printf("Querying the aircraft's description as an array of a fixed size...\n");
-    length = xplra_get_byte_array(result, sizeof(result)/sizeof(result[0]),
-                                  0, connectionID,
-                                  "sim/aircraft/view/acf_descrip");
-    if (length<0) goto error;
-    printf("Got %zu bytes, as a string: '%s'\n\n", length, result);
-
-    printf("Querying the aircraft's description as a dynamically created array with an offset of 3...\n");
-    length1 = 0;
-    result1 = xplra_get_byte_array_new(&length1, 3, connectionID,
-                                       "sim/aircraft/view/acf_descrip");
-    if (result1==0) goto error;
-    printf("Got %zu bytes, as a string: '%s'\n\n", length1, result1);
-
-    printf("Querying the aircraft's engine types as an array of a fixed size...\n");
-    length = xplra_get_int_array(result3, sizeof(result3)/sizeof(result3[0]), 0,
-                                 connectionID, "sim/aircraft/prop/acf_en_type");
-
-    if (length<0) goto error;
-    printf("Got %zd values:", length);
-    for(i = 0; i<length; ++i) {
-        if (i>0) printf(",");
-        printf(" %d", result3[i]);
-    }
-    printf("\n\n");
-
-    printf("Querying the aircraft's engine types as a dynamically created array...\n");
-    length1 = 0;
-    result4 = xplra_get_int_array_new(&length1, 0, connectionID,
-                                      "sim/aircraft/prop/acf_en_type");
-    printf("Got %zu values:", length1);
-    for(j = 0; j<length1; ++j) {
-        if (j>0) printf(",");
-        printf(" %d", result4[j]);
-    }
-    printf("\n\n");
-
-    printf("Querying the aircraft's propeller direction as an array of a fixed size...\n");
-    length = xplra_get_float_array(result5, sizeof(result5)/sizeof(result5[0]),
-                                   0, connectionID,
-                                   "sim/aircraft/prop/acf_prop_dir");
-    printf("Got %zd values:", length);
-    for(i = 0; i<length; ++i) {
-        if (i>0) printf(",");
-        printf(" %f", result5[i]);
-    }
-    printf("\n\n");
-
-    printf("Querying the aircraft's propeller direction as a dynamically created array...\n");
-    length1 = 0;
-    result6 = xplra_get_float_array_new(&length1, 0, connectionID,
-                                        "sim/aircraft/prop/acf_prop_dir");
-    printf("Got %zu values:", length1);
-    for(j = 0; j<length1; ++j) {
-        if (j>0) printf(",");
-        printf(" %f", result6[j]);
-    }
-    printf("\n\n");
-
-    printf("Setting the number of the engines to %d...\n", numEngines + 1);
-    if (xplra_set_int(connectionID, "sim/aircraft/engine/acf_num_engines",
-                      numEngines + 1)<0)
-    {
-        goto error;
-    }
-    if (xplra_get_int(&numEngines, connectionID,
-                      "sim/aircraft/engine/acf_num_engines")<0)
-    {
-        goto error;
-    }
-    printf("The new number of engines: %d\n\n", numEngines);
-
-
-    if (xplra_get_float(&acfElevUp, connectionID,
-                        "sim/aircraft/controls/acf_elev_up")<0)
-    {
-        goto error;
-    }
-    printf("Setting the aircraft elevator up control from %f to %f...\n",
-           acfElevUp, acfElevUp + 15.0);
-    if (xplra_set_float(connectionID,
-                        "sim/aircraft/controls/acf_elev_up",
-                        acfElevUp + 15.0) < 0)
-    {
-        goto error;
-    }
-    if (xplra_get_float(&acfElevUp, connectionID,
-                        "sim/aircraft/controls/acf_elev_up")<0)
-    {
-        goto error;
-    }
-    printf("The aircraft elevator up control set to %f\n\n", acfElevUp);
-
-    if (xplra_get_double(&localX, connectionID,
-                         "sim/flightmodel/position/local_x")<0)
-    {
-        goto error;
-    }
-    printf("Setting the aircraft's local X-coordinate from %f to %f...\n",
-           localX, localX + 15.0);
-    if (xplra_set_double(connectionID, "sim/flightmodel/position/local_x",
-                         localX + 15.0)<0)
-    {
-        goto error;
-    }
-    if (xplra_get_double(&localX, connectionID,
-                         "sim/flightmodel/position/local_x")<0)
-    {
-        goto error;
-    }
-    printf("The aircraft's local X-coordinate set to %f\n\n", localX);
-
-    length = xplra_get_float_array(numBlades,
-                                   sizeof(numBlades)/sizeof(numBlades[0]), 0,
-                                   connectionID,
-                                   "sim/aircraft/prop/acf_num_blades");
-    if (length<0) goto error;
-
-    printf("Setting the number of blades\n    from:");
-    for(i = 0; i<length; ++i) {
-        if (i>0) printf(",");
-        printf(" %f", numBlades[i]);
-    }
-    printf("\n    to:");
-    for(i = 0; i<length; ++i) {
-        numBlades[i] += 2.5;
-        if (i>0) printf(",");
-        printf(" %f", numBlades[i]);
-    }
-    printf("\n");
-    if (xplra_set_float_array(connectionID,
-                              "sim/aircraft/prop/acf_num_blades",
-                              numBlades, length, 0)<0)
-    {
-        goto error;
-    }
-    length = xplra_get_float_array(numBlades,
-                                   sizeof(numBlades)/sizeof(numBlades[0]), 0,
-                                   connectionID,
-                                   "sim/aircraft/prop/acf_num_blades");
-    if (length<0) goto error;
-    printf("The result:");
-    for(i = 0; i<length; ++i) {
-        if (i>0) printf(",");
-        printf(" %f", numBlades[i]);
-    }
-    printf("\n\n");
-
-    length = xplra_get_int_array(batteryArrayOn,
-                                 sizeof(batteryArrayOn)/sizeof(batteryArrayOn[0]),
-                                 0, connectionID,
-                                 "sim/cockpit/electrical/battery_array_on");
-    if (length<0) goto error;
-    printf("Setting the batteries\n    from:");
-    for(i = 0; i<length; ++i) {
-        if (i>0) printf(",");
-        printf(" %d", batteryArrayOn[i]);
-    }
-    printf("\n    to:");
-    for(i = 0; i<length; ++i) {
-        batteryArrayOn[i] = !batteryArrayOn[i];
-        numBlades[i] += 2.5;
-        if (i>0) printf(",");
-        printf(" %d", batteryArrayOn[i]);
-    }
-    printf("\n");
-    if (xplra_set_int_array(connectionID,
-                            "sim/cockpit/electrical/battery_array_on",
-                            batteryArrayOn, length, 0)<0)
-    {
-        goto error;
-    }
-    length = xplra_get_int_array(batteryArrayOn,
-                                 sizeof(batteryArrayOn)/sizeof(batteryArrayOn[0]),
-                                 0, connectionID,
-                                 "sim/cockpit/electrical/battery_array_on");
-    if (length<0) goto error;
-    printf("The result:");
-    for(i = 0; i<length; ++i) {
-        if (i>0) printf(",");
-        printf(" %d", batteryArrayOn[i]);
-    }
-    printf("\n\n");
-
-    memset(tailNum, 0, sizeof(tailNum));
-    strcpy((char*)tailNum, "HA-VAI");
-    printf("Setting the tail number to %s as a byte array...\n", tailNum);
-    if (xplra_set_byte_array(connectionID,
-                             "sim/aircraft/view/acf_tailnum",
-                             tailNum, sizeof(tailNum), 0)<0)
-    {
-        goto error;
-    }
-
-    memset(tailNum, 0, sizeof(tailNum));
-    length = xplra_get_byte_array(tailNum, sizeof(tailNum), 0,
-                                  connectionID,
-                                  "sim/aircraft/view/acf_tailnum");
-    if (length<0) goto error;
-    printf("The tail number is: '%s'\n\n", (char*)tailNum);
-
-    printf("Setting the tail number to %s as a string...\n", tailNum1);
-    if (xplra_set_string(connectionID, "sim/aircraft/view/acf_tailnum",
-                         tailNum1, 40, 0)<0)
-    {
-        goto error;
-    }
-    memset(tailNum, 0, sizeof(tailNum));
-    length = xplra_get_byte_array(tailNum, sizeof(tailNum), 0,
-                                  connectionID,
-                                  "sim/aircraft/view/acf_tailnum");
-    if (length<0) goto error;
-    printf("The tail number is: '%s'\n\n", (char*)tailNum);
-
-    printf("Preparing for the message tests, sleeping for 5 seconds...\n");
-    _sleep(5*1000);
-
-    printf("Showing a message for 10 seconds...\n");
-    if (xplra_show_message(connectionID, "[basictest] this message appears for 10 seconds", 10.0)<0) {
-        goto error;
-    }
-
-    printf("Sleeping for 3 seconds...\n");
-    _sleep(3*1000);
-
-    printf("Showing another message interrupting the previous one for 3 seconds");
-    if (xplra_show_message(connectionID, "[basictest] but this message interrupts it, and is displayed for 3 seconds", 3.0)<0) {
-        goto error;
-    }
-
-    printf("Sleeping for 5 seconds...\n");
-    _sleep(5*1000);
-    if (xplra_show_message(connectionID, "[basictest] and the tests come to an end!", 5.0)<0) {
-        goto error;
-    }
-
-    goto cleanup;
-error:
-    errorString = xplra_get_last_error_string(connectionID);
-    if (errorString==0) {
-        printf("\nUnknown error occured!\n");
-    } else {
-        printf("\nError: %s\n", errorString);
-    }
-
-    retval = 1;
-
-cleanup:
-    if (connectionID>=0) xplra_disconnect(connectionID);
-    return retval;
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: test/basictest.cc
===================================================================
--- test/basictest.cc	(revision 40)
+++ test/basictest.cc	(revision 40)
@@ -0,0 +1,282 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of XPLRA, a remote-access plugin for X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include <hu/varadiistvan/xplra/XPlane.h>
+
+#include <hu/varadiistvan/scpl/Thread.h>
+
+#include <cstdio>
+#include <cstring>
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::xplra::XPlane;
+using hu::varadiistvan::xplra::Exception;
+using hu::varadiistvan::xplra::ProtocolException;
+
+using hu::varadiistvan::scpl::Thread;
+
+using std::string;
+
+//------------------------------------------------------------------------------
+
+int main()
+{
+    try {
+        XPlane xplane;
+
+        printf("Connecting to X-Plane...\n");
+        xplane.connect();
+        printf("Connected to X-Plane.\n\n");
+
+        int xplaneVersion = 0;
+        int xplmVersion = 0;
+        int xplraVersion = 0;
+
+        printf("Showing a message...\n");
+        xplane.showMessage("[basictest] Starting tests", 5.0);
+        printf("\n");
+
+        printf("Querying the versions...\n");
+        xplane.getVersions(xplaneVersion, xplmVersion, xplraVersion);
+        printf("X-Plane version: %d, XPLM: %d, XPLRA: %03d\n\n",
+               xplaneVersion, xplmVersion, xplraVersion);
+
+        printf("Querying the number of the engines...\n");
+        int numEngines = xplane.getInt("sim/aircraft/engine/acf_num_engines");
+        printf("The number of engines: %d\n\n", numEngines);
+
+        try {
+            printf("Querying an invalid dataref...\n");
+            xplane.getInt("sim/aircraft/engine/num_engines");
+            printf("\n>>>>>>>>>>>> Succeeded!!!!!!!!!!!!!!!!!!!!!!\n\n");
+        } catch(const ProtocolException& exception) {
+            printf("Exception caugth: %s\n\n", exception.what());
+        }
+
+        printf("Querying the spool time of a jet engine...\n");
+        float spoolTime = xplane.getFloat("sim/aircraft/engine/acf_spooltime_jet");
+        printf("The spool time: %f\n\n", spoolTime);
+
+        printf("Querying the spool time of a propeller...\n");
+        spoolTime = xplane.getFloat("sim/aircraft/engine/acf_spooltime_prop");
+        printf("The spool time: %f\n\n", spoolTime);
+
+        printf("Querying the coordinates...\n");
+        double latitude = xplane.getDouble("sim/flightmodel/position/latitude");
+        double longitude = xplane.getDouble("sim/flightmodel/position/longitude");
+        printf("The coordinates: %f, %f\n\n", latitude, longitude);
+
+        printf("Querying the aircraft's description as an array of a fixed size...\n");
+        uint8_t result[260];
+        size_t length = xplane.getByteArray("sim/aircraft/view/acf_descrip",
+                                            result, sizeof(result)/sizeof(result[0]));
+        printf("Got %zu bytes, as a string: '%s'\n\n", length, result);
+
+        printf("Querying the aircraft's description as a dynamically created array...\n");
+        uint8_t* result1 = xplane.getByteArray("sim/aircraft/view/acf_descrip", length);
+        printf("Got %zu bytes, as a string: '%s'\n\n", length, result1);
+
+        printf("Querying the aircraft's description as a string, with an offset of 3...\n");
+        string result2 = xplane.getString("sim/aircraft/view/acf_descrip", 3);
+        printf("Got: '%s'\n\n", result2.c_str());
+
+        printf("Querying the aircraft's engine types as an array of a fixed size...\n");
+        int32_t result3[8];
+        length = xplane.getIntArray("sim/aircraft/prop/acf_en_type",
+                                    result3, sizeof(result3)/sizeof(result3[0]));
+        printf("Got %zu values:", length);
+        for(size_t i = 0; i<length; ++i) {
+            if (i>0) printf(",");
+            printf(" %d", result3[i]);
+        }
+        printf("\n\n");
+
+        printf("Querying the aircraft's engine types as a dynamically created array...\n");
+        length = 0;
+        int32_t* result4 = xplane.getIntArray("sim/aircraft/prop/acf_en_type", length);
+        printf("Got %zu values:", length);
+        for(size_t i = 0; i<length; ++i) {
+            if (i>0) printf(",");
+            printf(" %d", result4[i]);
+        }
+        printf("\n\n");
+
+        printf("Querying the aircraft's propeller direction as an array of a fixed size...\n");
+        float result5[8];
+        length = xplane.getFloatArray("sim/aircraft/prop/acf_prop_dir",
+                                      result5, sizeof(result5)/sizeof(result5[0]));
+        printf("Got %zu values:", length);
+        for(size_t i = 0; i<length; ++i) {
+            if (i>0) printf(",");
+            printf(" %f", result5[i]);
+        }
+        printf("\n\n");
+
+        printf("Querying the aircraft's propeller direction as a dynamically created array...\n");
+        length = 0;
+        float* result6 = xplane.getFloatArray("sim/aircraft/prop/acf_prop_dir", length);
+        printf("Got %zu values:", length);
+        for(size_t i = 0; i<length; ++i) {
+            if (i>0) printf(",");
+            printf(" %f", result6[i]);
+        }
+        printf("\n\n");
+
+        printf("Setting the number of the engines to %d...\n", numEngines + 1);
+        xplane.setInt("sim/aircraft/engine/acf_num_engines", numEngines + 1);
+        numEngines = xplane.getInt("sim/aircraft/engine/acf_num_engines");
+        printf("The new number of engines: %d\n\n", numEngines);
+
+        float acfElevUp = xplane.getFloat("sim/aircraft/controls/acf_elev_up");
+        printf("Setting the aircraft elevator up control from %f to %f...\n",
+               acfElevUp, acfElevUp + 15.0);
+        xplane.setFloat("sim/aircraft/controls/acf_elev_up", acfElevUp + 15.0);
+        acfElevUp = xplane.getFloat("sim/aircraft/controls/acf_elev_up");
+        printf("The aircraft elevator up control set to %f\n\n", acfElevUp);
+
+        double localX = xplane.getDouble("sim/flightmodel/position/local_x");
+        printf("Setting the aircraft's local X-coordinate from %f to %f...\n",
+               localX, localX + 15.0);
+        xplane.setDouble("sim/flightmodel/position/local_x", localX + 15.0);
+        localX = xplane.getDouble("sim/flightmodel/position/local_x");
+        printf("The aircraft's local X-coordinate set to %f\n\n", localX);
+
+        float numBlades[8];
+        length = xplane.getFloatArray("sim/aircraft/prop/acf_num_blades",
+                                      numBlades, sizeof(numBlades)/sizeof(numBlades[0]));
+
+        printf("Setting the number of blades\n    from:");
+        for(size_t i = 0; i<length; ++i) {
+            if (i>0) printf(",");
+            printf(" %f", numBlades[i]);
+        }
+        printf("\n    to:");
+        for(size_t i = 0; i<length; ++i) {
+            numBlades[i] += 2.5;
+            if (i>0) printf(",");
+            printf(" %f", numBlades[i]);
+        }
+        printf("\n");
+        xplane.setFloatArray("sim/aircraft/prop/acf_num_blades",
+                             numBlades, length);
+        length = xplane.getFloatArray("sim/aircraft/prop/acf_num_blades",
+                                      numBlades, sizeof(numBlades)/sizeof(numBlades[0]));
+        printf("The result:");
+        for(size_t i = 0; i<length; ++i) {
+            if (i>0) printf(",");
+            printf(" %f", numBlades[i]);
+        }
+        printf("\n\n");
+
+        int32_t batteryArrayOn[8];
+        length = xplane.getIntArray("sim/cockpit/electrical/battery_array_on",
+                                    batteryArrayOn,
+                                    sizeof(batteryArrayOn)/sizeof(batteryArrayOn[0]));
+
+        printf("Setting the batteries\n    from:");
+        for(size_t i = 0; i<length; ++i) {
+            if (i>0) printf(",");
+            printf(" %d", batteryArrayOn[i]);
+        }
+        printf("\n    to:");
+        for(size_t i = 0; i<length; ++i) {
+            batteryArrayOn[i] = !batteryArrayOn[i];
+            numBlades[i] += 2.5;
+            if (i>0) printf(",");
+            printf(" %d", batteryArrayOn[i]);
+        }
+        printf("\n");
+        xplane.setIntArray("sim/cockpit/electrical/battery_array_on",
+                           batteryArrayOn, length);
+        length = xplane.getIntArray("sim/cockpit/electrical/battery_array_on",
+                                    batteryArrayOn,
+                                    sizeof(batteryArrayOn)/sizeof(batteryArrayOn[0]));
+        printf("The result:");
+        for(size_t i = 0; i<length; ++i) {
+            if (i>0) printf(",");
+            printf(" %d", batteryArrayOn[i]);
+        }
+        printf("\n\n");
+
+        uint8_t tailNum[40];
+        memset(tailNum, 0, sizeof(tailNum));
+        strcpy(reinterpret_cast<char*>(tailNum), "HA-VAI");
+        printf("Setting the tail number to %s as a byte array...\n", tailNum);
+        xplane.setByteArray("sim/aircraft/view/acf_tailnum",
+                            tailNum, sizeof(tailNum));
+        printf("The tail number is: '%s'\n\n",
+               xplane.getString("sim/aircraft/view/acf_tailnum").c_str());
+
+        static const char* tailNum1 = "VAI";
+        printf("Setting the tail number to %s as a string...\n", tailNum1);
+        xplane.setString("sim/aircraft/view/acf_tailnum", tailNum1, 40);
+        printf("The tail number is: '%s'\n\n",
+               xplane.getString("sim/aircraft/view/acf_tailnum").c_str());
+
+        try {
+            printf("Querying an invalid dataref...\n");
+            xplane.getInt("sim/aircraft/engine/num_engines");
+            printf("\n>>>>>>>>>>>> Succeeded!!!!!!!!!!!!!!!!!!!!!!\n\n");
+        } catch(const ProtocolException& exception) {
+            printf("Exception caugth: %s\n\n", exception.what());
+        }
+
+        printf("Preparing for the message tests, sleeping for 5 seconds...\n");
+        Thread::sleep(5*1000);
+
+        printf("Showing a message for 10 seconds...\n");
+        xplane.showMessage("[basictest] this message appears for 10 seconds", 10.0);
+
+        printf("Sleeping for 3 seconds...\n");
+        Thread::sleep(3*1000);
+
+        printf("Showing another message interrupting the previous one for 3 seconds\n");
+        xplane.showMessage("[basictest] but this message interrupts it, and is displayed for 3 seconds", 3.0);
+
+        printf("Sleeping for 5 seconds...\n");
+        Thread::sleep(5*1000);
+        xplane.showMessage("[basictest] and the tests come to an end!", 5.0);
+
+        return 0;
+    } catch(const Exception& exception) {
+        printf("\n>>>>>>>>>>>>>>>>> Exception caugth: %s\n", exception.what());
+
+        return 1;
+    }
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: test/basictest.cc
===================================================================
--- test/basictest.cc	(revision 40)
+++ 	(revision )
@@ -1,282 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of XPLRA, a remote-access plugin for X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include <hu/varadiistvan/xplra/XPlane.h>
-
-#include <hu/varadiistvan/scpl/Thread.h>
-
-#include <cstdio>
-#include <cstring>
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::xplra::XPlane;
-using hu::varadiistvan::xplra::Exception;
-using hu::varadiistvan::xplra::ProtocolException;
-
-using hu::varadiistvan::scpl::Thread;
-
-using std::string;
-
-//------------------------------------------------------------------------------
-
-int main()
-{
-    try {
-        XPlane xplane;
-
-        printf("Connecting to X-Plane...\n");
-        xplane.connect();
-        printf("Connected to X-Plane.\n\n");
-
-        int xplaneVersion = 0;
-        int xplmVersion = 0;
-        int xplraVersion = 0;
-
-        printf("Showing a message...\n");
-        xplane.showMessage("[basictest] Starting tests", 5.0);
-        printf("\n");
-
-        printf("Querying the versions...\n");
-        xplane.getVersions(xplaneVersion, xplmVersion, xplraVersion);
-        printf("X-Plane version: %d, XPLM: %d, XPLRA: %03d\n\n",
-               xplaneVersion, xplmVersion, xplraVersion);
-
-        printf("Querying the number of the engines...\n");
-        int numEngines = xplane.getInt("sim/aircraft/engine/acf_num_engines");
-        printf("The number of engines: %d\n\n", numEngines);
-
-        try {
-            printf("Querying an invalid dataref...\n");
-            xplane.getInt("sim/aircraft/engine/num_engines");
-            printf("\n>>>>>>>>>>>> Succeeded!!!!!!!!!!!!!!!!!!!!!!\n\n");
-        } catch(const ProtocolException& exception) {
-            printf("Exception caugth: %s\n\n", exception.what());
-        }
-
-        printf("Querying the spool time of a jet engine...\n");
-        float spoolTime = xplane.getFloat("sim/aircraft/engine/acf_spooltime_jet");
-        printf("The spool time: %f\n\n", spoolTime);
-
-        printf("Querying the spool time of a propeller...\n");
-        spoolTime = xplane.getFloat("sim/aircraft/engine/acf_spooltime_prop");
-        printf("The spool time: %f\n\n", spoolTime);
-
-        printf("Querying the coordinates...\n");
-        double latitude = xplane.getDouble("sim/flightmodel/position/latitude");
-        double longitude = xplane.getDouble("sim/flightmodel/position/longitude");
-        printf("The coordinates: %f, %f\n\n", latitude, longitude);
-
-        printf("Querying the aircraft's description as an array of a fixed size...\n");
-        uint8_t result[260];
-        size_t length = xplane.getByteArray("sim/aircraft/view/acf_descrip",
-                                            result, sizeof(result)/sizeof(result[0]));
-        printf("Got %zu bytes, as a string: '%s'\n\n", length, result);
-
-        printf("Querying the aircraft's description as a dynamically created array...\n");
-        uint8_t* result1 = xplane.getByteArray("sim/aircraft/view/acf_descrip", length);
-        printf("Got %zu bytes, as a string: '%s'\n\n", length, result1);
-
-        printf("Querying the aircraft's description as a string, with an offset of 3...\n");
-        string result2 = xplane.getString("sim/aircraft/view/acf_descrip", 3);
-        printf("Got: '%s'\n\n", result2.c_str());
-
-        printf("Querying the aircraft's engine types as an array of a fixed size...\n");
-        int32_t result3[8];
-        length = xplane.getIntArray("sim/aircraft/prop/acf_en_type",
-                                    result3, sizeof(result3)/sizeof(result3[0]));
-        printf("Got %zu values:", length);
-        for(size_t i = 0; i<length; ++i) {
-            if (i>0) printf(",");
-            printf(" %d", result3[i]);
-        }
-        printf("\n\n");
-
-        printf("Querying the aircraft's engine types as a dynamically created array...\n");
-        length = 0;
-        int32_t* result4 = xplane.getIntArray("sim/aircraft/prop/acf_en_type", length);
-        printf("Got %zu values:", length);
-        for(size_t i = 0; i<length; ++i) {
-            if (i>0) printf(",");
-            printf(" %d", result4[i]);
-        }
-        printf("\n\n");
-
-        printf("Querying the aircraft's propeller direction as an array of a fixed size...\n");
-        float result5[8];
-        length = xplane.getFloatArray("sim/aircraft/prop/acf_prop_dir",
-                                      result5, sizeof(result5)/sizeof(result5[0]));
-        printf("Got %zu values:", length);
-        for(size_t i = 0; i<length; ++i) {
-            if (i>0) printf(",");
-            printf(" %f", result5[i]);
-        }
-        printf("\n\n");
-
-        printf("Querying the aircraft's propeller direction as a dynamically created array...\n");
-        length = 0;
-        float* result6 = xplane.getFloatArray("sim/aircraft/prop/acf_prop_dir", length);
-        printf("Got %zu values:", length);
-        for(size_t i = 0; i<length; ++i) {
-            if (i>0) printf(",");
-            printf(" %f", result6[i]);
-        }
-        printf("\n\n");
-
-        printf("Setting the number of the engines to %d...\n", numEngines + 1);
-        xplane.setInt("sim/aircraft/engine/acf_num_engines", numEngines + 1);
-        numEngines = xplane.getInt("sim/aircraft/engine/acf_num_engines");
-        printf("The new number of engines: %d\n\n", numEngines);
-
-        float acfElevUp = xplane.getFloat("sim/aircraft/controls/acf_elev_up");
-        printf("Setting the aircraft elevator up control from %f to %f...\n",
-               acfElevUp, acfElevUp + 15.0);
-        xplane.setFloat("sim/aircraft/controls/acf_elev_up", acfElevUp + 15.0);
-        acfElevUp = xplane.getFloat("sim/aircraft/controls/acf_elev_up");
-        printf("The aircraft elevator up control set to %f\n\n", acfElevUp);
-
-        double localX = xplane.getDouble("sim/flightmodel/position/local_x");
-        printf("Setting the aircraft's local X-coordinate from %f to %f...\n",
-               localX, localX + 15.0);
-        xplane.setDouble("sim/flightmodel/position/local_x", localX + 15.0);
-        localX = xplane.getDouble("sim/flightmodel/position/local_x");
-        printf("The aircraft's local X-coordinate set to %f\n\n", localX);
-
-        float numBlades[8];
-        length = xplane.getFloatArray("sim/aircraft/prop/acf_num_blades",
-                                      numBlades, sizeof(numBlades)/sizeof(numBlades[0]));
-
-        printf("Setting the number of blades\n    from:");
-        for(size_t i = 0; i<length; ++i) {
-            if (i>0) printf(",");
-            printf(" %f", numBlades[i]);
-        }
-        printf("\n    to:");
-        for(size_t i = 0; i<length; ++i) {
-            numBlades[i] += 2.5;
-            if (i>0) printf(",");
-            printf(" %f", numBlades[i]);
-        }
-        printf("\n");
-        xplane.setFloatArray("sim/aircraft/prop/acf_num_blades",
-                             numBlades, length);
-        length = xplane.getFloatArray("sim/aircraft/prop/acf_num_blades",
-                                      numBlades, sizeof(numBlades)/sizeof(numBlades[0]));
-        printf("The result:");
-        for(size_t i = 0; i<length; ++i) {
-            if (i>0) printf(",");
-            printf(" %f", numBlades[i]);
-        }
-        printf("\n\n");
-
-        int32_t batteryArrayOn[8];
-        length = xplane.getIntArray("sim/cockpit/electrical/battery_array_on",
-                                    batteryArrayOn,
-                                    sizeof(batteryArrayOn)/sizeof(batteryArrayOn[0]));
-
-        printf("Setting the batteries\n    from:");
-        for(size_t i = 0; i<length; ++i) {
-            if (i>0) printf(",");
-            printf(" %d", batteryArrayOn[i]);
-        }
-        printf("\n    to:");
-        for(size_t i = 0; i<length; ++i) {
-            batteryArrayOn[i] = !batteryArrayOn[i];
-            numBlades[i] += 2.5;
-            if (i>0) printf(",");
-            printf(" %d", batteryArrayOn[i]);
-        }
-        printf("\n");
-        xplane.setIntArray("sim/cockpit/electrical/battery_array_on",
-                           batteryArrayOn, length);
-        length = xplane.getIntArray("sim/cockpit/electrical/battery_array_on",
-                                    batteryArrayOn,
-                                    sizeof(batteryArrayOn)/sizeof(batteryArrayOn[0]));
-        printf("The result:");
-        for(size_t i = 0; i<length; ++i) {
-            if (i>0) printf(",");
-            printf(" %d", batteryArrayOn[i]);
-        }
-        printf("\n\n");
-
-        uint8_t tailNum[40];
-        memset(tailNum, 0, sizeof(tailNum));
-        strcpy(reinterpret_cast<char*>(tailNum), "HA-VAI");
-        printf("Setting the tail number to %s as a byte array...\n", tailNum);
-        xplane.setByteArray("sim/aircraft/view/acf_tailnum",
-                            tailNum, sizeof(tailNum));
-        printf("The tail number is: '%s'\n\n",
-               xplane.getString("sim/aircraft/view/acf_tailnum").c_str());
-
-        static const char* tailNum1 = "VAI";
-        printf("Setting the tail number to %s as a string...\n", tailNum1);
-        xplane.setString("sim/aircraft/view/acf_tailnum", tailNum1, 40);
-        printf("The tail number is: '%s'\n\n",
-               xplane.getString("sim/aircraft/view/acf_tailnum").c_str());
-
-        try {
-            printf("Querying an invalid dataref...\n");
-            xplane.getInt("sim/aircraft/engine/num_engines");
-            printf("\n>>>>>>>>>>>> Succeeded!!!!!!!!!!!!!!!!!!!!!!\n\n");
-        } catch(const ProtocolException& exception) {
-            printf("Exception caugth: %s\n\n", exception.what());
-        }
-
-        printf("Preparing for the message tests, sleeping for 5 seconds...\n");
-        Thread::sleep(5*1000);
-
-        printf("Showing a message for 10 seconds...\n");
-        xplane.showMessage("[basictest] this message appears for 10 seconds", 10.0);
-
-        printf("Sleeping for 3 seconds...\n");
-        Thread::sleep(3*1000);
-
-        printf("Showing another message interrupting the previous one for 3 seconds\n");
-        xplane.showMessage("[basictest] but this message interrupts it, and is displayed for 3 seconds", 3.0);
-
-        printf("Sleeping for 5 seconds...\n");
-        Thread::sleep(5*1000);
-        xplane.showMessage("[basictest] and the tests come to an end!", 5.0);
-
-        return 0;
-    } catch(const Exception& exception) {
-        printf("\n>>>>>>>>>>>>>>>>> Exception caugth: %s\n", exception.what());
-
-        return 1;
-    }
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: test/basictest.py
===================================================================
--- test/basictest.py	(revision 40)
+++ test/basictest.py	(revision 40)
@@ -0,0 +1,162 @@
+# Basic test program for the Python client library
+
+#------------------------------------------------------------------------------
+
+import time
+
+#------------------------------------------------------------------------------
+
+if __name__ == "__main__":
+    from xplra import XPlane, ProtocolException
+
+    xplane = XPlane()
+
+    try:
+        print "Connecting to X-Plane..."
+        xplane.connect()
+        print "Connected to X-Plane."
+        print
+
+        print "Showing a message..."
+        xplane.showMessage("[basictest] Starting tests", 5.0)
+        print
+
+        print "Querying the versions..."
+        (xplaneVersion, xplmVersion, xplraVersion) = xplane.getVersions()
+        print "X-Plane version: %d, XPLM: %d, XPLRA: %03d" % \
+               (xplaneVersion, xplmVersion, xplraVersion)
+        print
+
+        print "Querying the number of the engines..."
+        numEngines = xplane.getInt("sim/aircraft/engine/acf_num_engines")
+        print "The number of engines:", numEngines
+        print
+
+        try:
+            print "Querying an invalid dataref..."
+            xplane.getInt("sim/aircraft/engine/num_engines")
+            print
+            print ">>>>>>>>>>>> Succeeded!!!!!!!!!!!!!!!!!!!!!!"
+        except ProtocolException as e:
+            print "Exception caugth:", str(e)
+        print
+
+        print "Querying the spool time of a jet engine..."
+        spoolTime = xplane.getFloat("sim/aircraft/engine/acf_spooltime_jet")
+        print "The spool time:", spoolTime
+        print
+
+        print "Querying the spool time of a propeller..."
+        spoolTime = xplane.getFloat("sim/aircraft/engine/acf_spooltime_prop")
+        print "The spool time:", spoolTime
+        print
+
+        print "Querying the coordinates..."
+        latitude = xplane.getDouble("sim/flightmodel/position/latitude")
+        longitude = xplane.getDouble("sim/flightmodel/position/longitude")
+        print "The coordinates: " + `latitude` + ", " + `longitude`
+        print
+
+        print "Querying the aircraft's description..."
+        result = xplane.getByteArray("sim/aircraft/view/acf_descrip")
+        print "The description:", result
+        print
+
+        print "Querying the aircraft's description as a string, with an offset of 3..."
+        result2 = xplane.getString("sim/aircraft/view/acf_descrip", offset = 3);
+        print "Got: '" + result2 + "' (" + `len(result2)` + ")"
+        print result2=="h 8 Q400"
+        print
+
+        print "Querying the aircraft's engine types..."
+        result3 = xplane.getIntArray("sim/aircraft/prop/acf_en_type")
+        print "Got:", result3
+        print
+
+        print "Querying the aircraft's propeller directions..."
+        result5 = xplane.getFloatArray("sim/aircraft/prop/acf_prop_dir")
+        print  "Got:", result5
+        print
+
+        print "Setting the number of the engines to", numEngines + 1
+        xplane.setInt("sim/aircraft/engine/acf_num_engines", numEngines + 1)
+        numEngines = xplane.getInt("sim/aircraft/engine/acf_num_engines")
+        print "The new number of engines:", numEngines
+        print
+
+        acfElevUp = xplane.getFloat("sim/aircraft/controls/acf_elev_up")
+        print "Setting the aircraft elevator up control from %f to %f..." % \
+            (acfElevUp, acfElevUp + 15.0)
+        xplane.setFloat("sim/aircraft/controls/acf_elev_up", acfElevUp + 15.0)
+        acfElevUp = xplane.getFloat("sim/aircraft/controls/acf_elev_up")
+        print "The aircraft elevator up control set to", acfElevUp
+        print
+
+        localX = xplane.getDouble("sim/flightmodel/position/local_x")
+        print "Setting the aircraft's local X-coordinate from %f to %f..." % \
+            (localX, localX + 15.0)
+        xplane.setDouble("sim/flightmodel/position/local_x", localX + 15.0)
+        localX = xplane.getDouble("sim/flightmodel/position/local_x")
+        print "The aircraft's local X-coordinate set to", localX
+        print
+
+        numBlades = xplane.getFloatArray("sim/aircraft/prop/acf_num_blades")
+        print "Setting the number of blades"
+        print "    from:", numBlades
+        numBlades = [n+2.5 for n in numBlades]
+        print "    to:", numBlades
+        xplane.setFloatArray("sim/aircraft/prop/acf_num_blades",  numBlades)
+
+        numBlades = xplane.getFloatArray("sim/aircraft/prop/acf_num_blades")
+        print "The result:", numBlades
+        print
+
+        batteryArrayOn = xplane.getIntArray("sim/cockpit/electrical/battery_array_on")
+        print "Setting the batteries"
+        print "    from:", batteryArrayOn
+        batteryArrayOn = [1 if b==0 else 0 for b in batteryArrayOn]
+        print "    to:", batteryArrayOn
+        xplane.setIntArray("sim/cockpit/electrical/battery_array_on", batteryArrayOn)
+        batteryArrayOn = xplane.getIntArray("sim/cockpit/electrical/battery_array_on")
+        print "The result:", batteryArrayOn
+        print
+
+        tailNum = [0] * 40
+        tailNum[0] = ord('H')
+        tailNum[1] = ord('A')
+        tailNum[2] = ord('-')
+        tailNum[3] = ord('V')
+        tailNum[4] = ord('A')
+        tailNum[5] = ord('I')
+
+        print "Setting the tail number to %s as a byte array..." % (tailNum,)
+        xplane.setByteArray("sim/aircraft/view/acf_tailnum", tailNum)
+        print "The tail number is:", xplane.getString("sim/aircraft/view/acf_tailnum")
+        print
+
+        tailNum1 = "VAIS"
+        print "Setting the tail number to " + tailNum1 + " as a string..."
+        xplane.setString("sim/aircraft/view/acf_tailnum", tailNum1, 40)
+        print "The tail number is:", xplane.getString("sim/aircraft/view/acf_tailnum")
+        print
+
+        print "Preparing for the message tests, sleeping for 5 seconds..."
+        time.sleep(5.0)
+
+        print "Showing a message for 10 seconds..."
+        xplane.showMessage("[basictest] this message appears for 10 seconds", 10.0)
+
+        print "Sleeping for 3 seconds..."
+        time.sleep(3.0)
+
+        print "Showing another message interrupting the previous one for 3 seconds"
+        xplane.showMessage("[basictest] but this message interrupts it, and is displayed for 3 seconds", 3.0)
+
+        print "Sleeping for 5 seconds..."
+        time.sleep(5.0)
+        xplane.showMessage("[basictest] and the tests come to an end!", 5.0)
+
+    except Exception as e:
+        print ">>>>>>>>>>>>>>>>>>>>>> Exception caught:", str(e)
+    finally:
+        xplane.disconnect()
Index: test/basictest.py
===================================================================
--- test/basictest.py	(revision 40)
+++ 	(revision )
@@ -1,162 +1,0 @@
-# Basic test program for the Python client library
-
-#------------------------------------------------------------------------------
-
-import time
-
-#------------------------------------------------------------------------------
-
-if __name__ == "__main__":
-    from xplra import XPlane, ProtocolException
-
-    xplane = XPlane()
-
-    try:
-        print "Connecting to X-Plane..."
-        xplane.connect()
-        print "Connected to X-Plane."
-        print
-
-        print "Showing a message..."
-        xplane.showMessage("[basictest] Starting tests", 5.0)
-        print
-
-        print "Querying the versions..."
-        (xplaneVersion, xplmVersion, xplraVersion) = xplane.getVersions()
-        print "X-Plane version: %d, XPLM: %d, XPLRA: %03d" % \
-               (xplaneVersion, xplmVersion, xplraVersion)
-        print
-
-        print "Querying the number of the engines..."
-        numEngines = xplane.getInt("sim/aircraft/engine/acf_num_engines")
-        print "The number of engines:", numEngines
-        print
-
-        try:
-            print "Querying an invalid dataref..."
-            xplane.getInt("sim/aircraft/engine/num_engines")
-            print
-            print ">>>>>>>>>>>> Succeeded!!!!!!!!!!!!!!!!!!!!!!"
-        except ProtocolException as e:
-            print "Exception caugth:", str(e)
-        print
-
-        print "Querying the spool time of a jet engine..."
-        spoolTime = xplane.getFloat("sim/aircraft/engine/acf_spooltime_jet")
-        print "The spool time:", spoolTime
-        print
-
-        print "Querying the spool time of a propeller..."
-        spoolTime = xplane.getFloat("sim/aircraft/engine/acf_spooltime_prop")
-        print "The spool time:", spoolTime
-        print
-
-        print "Querying the coordinates..."
-        latitude = xplane.getDouble("sim/flightmodel/position/latitude")
-        longitude = xplane.getDouble("sim/flightmodel/position/longitude")
-        print "The coordinates: " + `latitude` + ", " + `longitude`
-        print
-
-        print "Querying the aircraft's description..."
-        result = xplane.getByteArray("sim/aircraft/view/acf_descrip")
-        print "The description:", result
-        print
-
-        print "Querying the aircraft's description as a string, with an offset of 3..."
-        result2 = xplane.getString("sim/aircraft/view/acf_descrip", offset = 3);
-        print "Got: '" + result2 + "' (" + `len(result2)` + ")"
-        print result2=="h 8 Q400"
-        print
-
-        print "Querying the aircraft's engine types..."
-        result3 = xplane.getIntArray("sim/aircraft/prop/acf_en_type")
-        print "Got:", result3
-        print
-
-        print "Querying the aircraft's propeller directions..."
-        result5 = xplane.getFloatArray("sim/aircraft/prop/acf_prop_dir")
-        print  "Got:", result5
-        print
-
-        print "Setting the number of the engines to", numEngines + 1
-        xplane.setInt("sim/aircraft/engine/acf_num_engines", numEngines + 1)
-        numEngines = xplane.getInt("sim/aircraft/engine/acf_num_engines")
-        print "The new number of engines:", numEngines
-        print
-
-        acfElevUp = xplane.getFloat("sim/aircraft/controls/acf_elev_up")
-        print "Setting the aircraft elevator up control from %f to %f..." % \
-            (acfElevUp, acfElevUp + 15.0)
-        xplane.setFloat("sim/aircraft/controls/acf_elev_up", acfElevUp + 15.0)
-        acfElevUp = xplane.getFloat("sim/aircraft/controls/acf_elev_up")
-        print "The aircraft elevator up control set to", acfElevUp
-        print
-
-        localX = xplane.getDouble("sim/flightmodel/position/local_x")
-        print "Setting the aircraft's local X-coordinate from %f to %f..." % \
-            (localX, localX + 15.0)
-        xplane.setDouble("sim/flightmodel/position/local_x", localX + 15.0)
-        localX = xplane.getDouble("sim/flightmodel/position/local_x")
-        print "The aircraft's local X-coordinate set to", localX
-        print
-
-        numBlades = xplane.getFloatArray("sim/aircraft/prop/acf_num_blades")
-        print "Setting the number of blades"
-        print "    from:", numBlades
-        numBlades = [n+2.5 for n in numBlades]
-        print "    to:", numBlades
-        xplane.setFloatArray("sim/aircraft/prop/acf_num_blades",  numBlades)
-
-        numBlades = xplane.getFloatArray("sim/aircraft/prop/acf_num_blades")
-        print "The result:", numBlades
-        print
-
-        batteryArrayOn = xplane.getIntArray("sim/cockpit/electrical/battery_array_on")
-        print "Setting the batteries"
-        print "    from:", batteryArrayOn
-        batteryArrayOn = [1 if b==0 else 0 for b in batteryArrayOn]
-        print "    to:", batteryArrayOn
-        xplane.setIntArray("sim/cockpit/electrical/battery_array_on", batteryArrayOn)
-        batteryArrayOn = xplane.getIntArray("sim/cockpit/electrical/battery_array_on")
-        print "The result:", batteryArrayOn
-        print
-
-        tailNum = [0] * 40
-        tailNum[0] = ord('H')
-        tailNum[1] = ord('A')
-        tailNum[2] = ord('-')
-        tailNum[3] = ord('V')
-        tailNum[4] = ord('A')
-        tailNum[5] = ord('I')
-
-        print "Setting the tail number to %s as a byte array..." % (tailNum,)
-        xplane.setByteArray("sim/aircraft/view/acf_tailnum", tailNum)
-        print "The tail number is:", xplane.getString("sim/aircraft/view/acf_tailnum")
-        print
-
-        tailNum1 = "VAIS"
-        print "Setting the tail number to " + tailNum1 + " as a string..."
-        xplane.setString("sim/aircraft/view/acf_tailnum", tailNum1, 40)
-        print "The tail number is:", xplane.getString("sim/aircraft/view/acf_tailnum")
-        print
-
-        print "Preparing for the message tests, sleeping for 5 seconds..."
-        time.sleep(5.0)
-
-        print "Showing a message for 10 seconds..."
-        xplane.showMessage("[basictest] this message appears for 10 seconds", 10.0)
-
-        print "Sleeping for 3 seconds..."
-        time.sleep(3.0)
-
-        print "Showing another message interrupting the previous one for 3 seconds"
-        xplane.showMessage("[basictest] but this message interrupts it, and is displayed for 3 seconds", 3.0)
-
-        print "Sleeping for 5 seconds..."
-        time.sleep(5.0)
-        xplane.showMessage("[basictest] and the tests come to an end!", 5.0)
-
-    except Exception as e:
-        print ">>>>>>>>>>>>>>>>>>>>>> Exception caught:", str(e)
-    finally:
-        xplane.disconnect()
Index: test/ctest.c
===================================================================
--- test/ctest.c	(revision 14)
+++ test/ctest.c	(revision 14)
@@ -0,0 +1,42 @@
+/* Copyright (c) 2013 by István Váradi
+ *
+ * This file is part of XPLRA, a remote-access plugin for X-Plane
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ *    list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those
+ * of the authors and should not be interpreted as representing official policies,
+ * either expressed or implied, of the FreeBSD Project.
+ */
+
+/*----------------------------------------------------------------------------*/
+
+#include <hu/varadiistvan/xplra/xplra.h>
+
+#include <stdio.h>
+
+/*----------------------------------------------------------------------------*/
+
+int main()
+{
+    printf("xplra_connect: %d\n", xplra_connect());
+    return 0;
+}
Index: test/ctest.c
===================================================================
--- test/ctest.c	(revision 14)
+++ 	(revision )
@@ -1,42 +1,0 @@
-/* Copyright (c) 2013 by István Váradi
- *
- * This file is part of XPLRA, a remote-access plugin for X-Plane
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- *    list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *    this list of conditions and the following disclaimer in the documentation
- *    and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those
- * of the authors and should not be interpreted as representing official policies,
- * either expressed or implied, of the FreeBSD Project.
- */
-
-/*----------------------------------------------------------------------------*/
-
-#include <hu/varadiistvan/xplra/xplra.h>
-
-#include <stdio.h>
-
-/*----------------------------------------------------------------------------*/
-
-int main()
-{
-    printf("xplra_connect: %d\n", xplra_connect());
-    return 0;
-}
Index: test/hotkeytest.py
===================================================================
--- test/hotkeytest.py	(revision 53)
+++ test/hotkeytest.py	(revision 53)
@@ -0,0 +1,47 @@
+# Test program for the Python client library: hotkey handling
+
+#------------------------------------------------------------------------------
+
+import time
+
+#------------------------------------------------------------------------------
+
+if __name__ == "__main__":
+    from xplra import XPlane, ProtocolException
+
+    xplane = XPlane()
+
+    try:
+        print "Connecting to X-Plane..."
+        xplane.connect()
+        print "Connected to X-Plane."
+        print
+
+        print "Registering hotkeys: Ctrl+A, Shift+B, Ctrl+Shift+C, Ctrl+Q..."
+        xplane.registerHotkeys([0x0241, 0x0142, 0x0343, 0x0251])
+        print "Registered hotkeys..."
+
+        print "Listening to hotkeys..."
+        while True:
+            states = xplane.queryHotkeys()
+            message = ""
+            if states[3]: break
+            if states[0]:
+                if message: message += ", "
+                message += "Ctrl+A"
+            if states[1]:
+                if message: message += ", "
+                message += "Shift+B"
+            if states[2]:
+                if message: message += ", "
+                message += "Ctrl+Shift+C"
+            if message:
+                message += " pressed"
+                xplane.showMessage(message, 3.0)
+
+            time.sleep(0.5)
+
+    except Exception as e:
+        print ">>>>>>>>>>>>>>>>>>>>>> Exception caught:", str(e)
+    finally:
+        xplane.disconnect()
Index: test/multigetctest.c
===================================================================
--- test/multigetctest.c	(revision 41)
+++ test/multigetctest.c	(revision 41)
@@ -0,0 +1,367 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of XPLRA, a remote-access plugin for X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include <hu/varadiistvan/xplra/xplra.h>
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#ifdef _WIN32
+#include <windows.h>
+#else
+#include <unistd.h>
+#endif
+
+//------------------------------------------------------------------------------
+
+int main(int argc, char* argv[])
+{
+    int retval = 0;
+    const char* errorString;
+
+    int i;
+
+    int connectionID = -1;
+    int wrongGetterID = -1;
+    int getterID = -1;
+
+    size_t tailnumID = INVALID_DATAREF_ID;
+    size_t daysID = INVALID_DATAREF_ID;
+    size_t zuluSecID = INVALID_DATAREF_ID;
+    size_t pausedID = INVALID_DATAREF_ID;
+    size_t latitudeID = INVALID_DATAREF_ID;
+    size_t longitudeID = INVALID_DATAREF_ID;
+    size_t replayID = INVALID_DATAREF_ID;
+    size_t overspeedID = INVALID_DATAREF_ID;
+    size_t stalledID = INVALID_DATAREF_ID;
+    size_t onTheGroundID = INVALID_DATAREF_ID;
+    size_t emptyWeightID = INVALID_DATAREF_ID;
+    size_t payloadWeightID = INVALID_DATAREF_ID;
+    size_t grossWeightID = INVALID_DATAREF_ID;
+    size_t headingID = INVALID_DATAREF_ID;
+    size_t pitchID = INVALID_DATAREF_ID;
+    size_t bankID = INVALID_DATAREF_ID;
+    size_t iasID = INVALID_DATAREF_ID;
+    size_t machID = INVALID_DATAREF_ID;
+    size_t groundSpeedID = INVALID_DATAREF_ID;
+    size_t vsID = INVALID_DATAREF_ID;
+    size_t radioAltitudeID = INVALID_DATAREF_ID;
+    size_t altitudeID = INVALID_DATAREF_ID;
+    size_t gLoadID = INVALID_DATAREF_ID;
+    size_t flapsControlID = INVALID_DATAREF_ID;
+    size_t flapsLeftID = INVALID_DATAREF_ID;
+    size_t flapsRightID = INVALID_DATAREF_ID;
+    size_t navLightsID = INVALID_DATAREF_ID;
+    size_t beaconLightsID = INVALID_DATAREF_ID;
+    size_t strobeLightsID = INVALID_DATAREF_ID;
+    size_t landingLightsID = INVALID_DATAREF_ID;
+    size_t pitotID = INVALID_DATAREF_ID;
+    size_t parkingID = INVALID_DATAREF_ID;
+    size_t gearControlID = INVALID_DATAREF_ID;
+    size_t noseGearID = INVALID_DATAREF_ID;
+    size_t altimeterID = INVALID_DATAREF_ID;
+    size_t qnhID = INVALID_DATAREF_ID;
+    size_t navTypesID = INVALID_DATAREF_ID;
+    size_t busVoltsID = INVALID_DATAREF_ID;
+
+    const char* tailnum = 0;
+    const int32_t* days = 0;
+    const float* zuluSec = 0;
+    const int32_t* paused = 0;
+    const double* latitude = 0;
+    const double* longitude = 0;
+    const int32_t* replay = 0;
+    const int32_t* overspeed = 0;
+    const int32_t* stalled = 0;
+    const int32_t* onTheGround = 0;
+    const float* emptyWeight = 0;
+    const float* payloadWeight = 0;
+    const float* grossWeight = 0;
+    const float* heading = 0;
+    const float* pitch = 0;
+    const float* bank = 0;
+    const float* ias = 0;
+    const float* mach = 0;
+    const float* groundSpeed = 0;
+    const float* vs = 0;
+    const float* radioAltitude = 0;
+    const float* altitude = 0;
+    const float* gLoad = 0;
+    const float* flapsControl = 0;
+    const float* flapsLeft = 0;
+    const float* flapsRight = 0;
+    const int32_t* navLights = 0;
+    const int32_t* beaconLights = 0;
+    const int32_t* strobeLights = 0;
+    const int32_t* landingLights = 0;
+    const int32_t* pitot = 0;
+    const float* parking = 0;
+    const int32_t* gearControl = 0;
+    const float* noseGear = 0;
+    const float* altimeter = 0;
+    const float* qnh = 0;
+    const int32_t* navTypes = 0;
+    const float* busVolts = 0;
+
+    int dontregister = 0;
+
+    for(i = 1; i<argc; ++i) {
+        if (strcmp(argv[i], "dontregister")==0) {
+            dontregister = 1;
+        }
+    }
+
+    printf("Connecting to X-Plane...\n");
+    connectionID = xplra_connect();
+    if (connectionID>=0) {
+        printf("Connected to X-Plane.\n\n");
+    } else {
+        printf("Connection failed.\n\n");
+        goto cleanup;
+    }
+
+    wrongGetterID = xplra_multi_create_getter(connectionID);
+    if (wrongGetterID<0) goto error;
+    xplra_multi_add_int(wrongGetterID, "sim/time/local_date_days");
+    xplra_multi_add_int(wrongGetterID, "sim/time/paused");
+    xplra_multi_add_int(wrongGetterID, "sim/time/hello_te_lo");
+    xplra_multi_add_float(wrongGetterID, "sim/time/zulu_time_sec");
+    xplra_multi_add_int(wrongGetterID, "sim/operation/prefs/replay_mode");
+
+    printf("Executing a multi-dataref getter with an invalid dataref...\n");
+    if (xplra_multi_execute(wrongGetterID)<0) {
+        printf("Error occured: %s\n\n",
+               xplra_get_last_error_string(connectionID));
+        xplra_clear_last_error(connectionID);
+    } else {
+        printf(">>>>>>>>>>>>>>>>>>>>> Succeeded, but it should not have!!!!\n\n");
+    }
+
+    printf("Executing a registered multi-dataref getter with an invalid dataref...\n");
+    if (xplra_multi_register(wrongGetterID)<0) goto error;
+    if (xplra_multi_execute(wrongGetterID)<0) {
+        printf("Error occured: %s\n\n",
+               xplra_get_last_error_string(connectionID));
+        xplra_clear_last_error(connectionID);
+    } else {
+        printf(">>>>>>>>>>>>>>>>>>>>> Succeeded, but it should not have!!!!\n\n");
+    }
+
+
+    getterID = xplra_multi_create_getter(connectionID);
+    if (getterID<0) goto error;
+
+    tailnumID = xplra_multi_add_byte_array(getterID, "sim/aircraft/view/acf_tailnum", 40, 0);
+    daysID = xplra_multi_add_int(getterID, "sim/time/local_date_days");
+    zuluSecID = xplra_multi_add_float(getterID, "sim/time/zulu_time_sec");
+    pausedID = xplra_multi_add_int(getterID, "sim/time/paused");
+    latitudeID = xplra_multi_add_double(getterID, "sim/flightmodel/position/latitude");
+    longitudeID = xplra_multi_add_double(getterID, "sim/flightmodel/position/longitude");
+    replayID = xplra_multi_add_int(getterID, "sim/operation/prefs/replay_mode");
+    overspeedID = xplra_multi_add_int(getterID, "sim/flightmodel/failures/over_vne");
+    stalledID = xplra_multi_add_int(getterID, "sim/flightmodel/failures/stallwarning");
+    onTheGroundID = xplra_multi_add_int(getterID, "sim/flightmodel/failures/onground_any");
+    emptyWeightID = xplra_multi_add_float(getterID, "sim/aircraft/weight/acf_m_empty");
+    payloadWeightID = xplra_multi_add_float(getterID, "sim/flightmodel/weight/m_fixed");
+    grossWeightID = xplra_multi_add_float(getterID, "sim/flightmodel/weight/m_total");
+    headingID = xplra_multi_add_float(getterID, "sim/flightmodel/position/psi");
+    pitchID = xplra_multi_add_float(getterID, "sim/flightmodel/position/theta");
+    bankID = xplra_multi_add_float(getterID, "sim/flightmodel/position/phi");
+    iasID = xplra_multi_add_float(getterID, "sim/flightmodel/position/indicated_airspeed2");
+    machID = xplra_multi_add_float(getterID, "sim/flightmodel/misc/machno");
+    groundSpeedID = xplra_multi_add_float(getterID, "sim/flightmodel/position/groundspeed");
+    vsID = xplra_multi_add_float(getterID, "sim/flightmodel/position/vh_ind_fpm2");
+    radioAltitudeID = xplra_multi_add_float(getterID, "sim/flightmodel/position/y_agl");
+    altitudeID = xplra_multi_add_float(getterID, "sim/flightmodel/position/elevation");
+    gLoadID = xplra_multi_add_float(getterID, "sim/flightmodel/forces/g_nrml");
+    flapsControlID = xplra_multi_add_float(getterID, "sim/flightmodel/controls/flaprqst");
+    flapsLeftID = xplra_multi_add_float(getterID, "sim/flightmodel/controls/flaprat");
+    flapsRightID = xplra_multi_add_float(getterID, "sim/flightmodel/controls/flap2rat");
+    navLightsID = xplra_multi_add_int(getterID, "sim/cockpit/electrical/nav_lights_on");
+    beaconLightsID = xplra_multi_add_int(getterID, "sim/cockpit/electrical/beacon_lights_on");
+    strobeLightsID = xplra_multi_add_int(getterID, "sim/cockpit/electrical/strobe_lights_on");
+    landingLightsID = xplra_multi_add_int(getterID, "sim/cockpit/electrical/landing_lights_on");
+    pitotID = xplra_multi_add_int(getterID, "sim/cockpit/switches/pitot_heat_on");
+    parkingID = xplra_multi_add_float(getterID, "sim/flightmodel/controls/parkbrake");
+    gearControlID = xplra_multi_add_int(getterID, "sim/cockpit2/controls/gear_handle_down");
+    noseGearID = xplra_multi_add_float_array(getterID, "sim/flightmodel2/gear/deploy_ratio", 1, 0);
+    altimeterID = xplra_multi_add_float(getterID, "sim/cockpit/misc/barometer_setting");
+    qnhID = xplra_multi_add_float(getterID, "sim/flightmodel/misc/Qstatic");
+    navTypesID = xplra_multi_add_int_array(getterID, "sim/cockpit/radios/nav_type", 6, 0);
+    busVoltsID = xplra_multi_add_float_array(getterID, "sim/cockpit2/electrical/bus_volts", 4, 0);
+
+    if (dontregister) {
+        xplra_multi_finalize(getterID);
+    } else {
+        printf("Registering getter...\n");
+        if (xplra_multi_register(getterID)<0) goto error;
+        printf("Registered getter.\n\n");
+    }
+
+    tailnum = xplra_multi_get_string_ptr(getterID, tailnumID, 0);
+    days = xplra_multi_get_int_ptr(getterID, daysID);
+    zuluSec = xplra_multi_get_float_ptr(getterID, zuluSecID);
+    paused = xplra_multi_get_int_ptr(getterID, pausedID);
+    latitude = xplra_multi_get_double_ptr(getterID, latitudeID);
+    longitude = xplra_multi_get_double_ptr(getterID, longitudeID);
+    // frozen
+    // slew
+    replay = xplra_multi_get_int_ptr(getterID, replayID);
+    overspeed = xplra_multi_get_int_ptr(getterID, overspeedID);
+    stalled = xplra_multi_get_int_ptr(getterID, stalledID);
+    onTheGround = xplra_multi_get_int_ptr(getterID, onTheGroundID);
+    emptyWeight = xplra_multi_get_float_ptr(getterID, emptyWeightID);
+    payloadWeight = xplra_multi_get_float_ptr(getterID, payloadWeightID);
+    grossWeight = xplra_multi_get_float_ptr(getterID, grossWeightID);
+    heading = xplra_multi_get_float_ptr(getterID, headingID);
+    pitch = xplra_multi_get_float_ptr(getterID, pitchID);
+    bank = xplra_multi_get_float_ptr(getterID, bankID);
+    ias = xplra_multi_get_float_ptr(getterID, iasID);
+    mach = xplra_multi_get_float_ptr(getterID, machID);
+    groundSpeed = xplra_multi_get_float_ptr(getterID, groundSpeedID);
+    vs = xplra_multi_get_float_ptr(getterID, vsID);
+    radioAltitude = xplra_multi_get_float_ptr(getterID, radioAltitudeID);
+    altitude = xplra_multi_get_float_ptr(getterID, altitudeID);
+    gLoad = xplra_multi_get_float_ptr(getterID, gLoadID);
+    flapsControl = xplra_multi_get_float_ptr(getterID, flapsControlID);
+    flapsLeft = xplra_multi_get_float_ptr(getterID, flapsLeftID);
+    flapsRight = xplra_multi_get_float_ptr(getterID, flapsRightID);
+    navLights = xplra_multi_get_int_ptr(getterID, navLightsID);
+    beaconLights = xplra_multi_get_int_ptr(getterID, beaconLightsID);
+    strobeLights = xplra_multi_get_int_ptr(getterID, strobeLightsID);
+    landingLights = xplra_multi_get_int_ptr(getterID, landingLightsID);
+    pitot = xplra_multi_get_int_ptr(getterID, pitotID);
+    parking = xplra_multi_get_float_ptr(getterID, parkingID);
+    gearControl = xplra_multi_get_int_ptr(getterID, gearControlID);
+    noseGear = xplra_multi_get_float_array_ptr(getterID, noseGearID, 0);
+    altimeter = xplra_multi_get_float_ptr(getterID, altimeterID);
+    qnh = xplra_multi_get_float_ptr(getterID, qnhID);
+    navTypes = xplra_multi_get_int_array_ptr(getterID, navTypesID, 0);
+    busVolts = xplra_multi_get_float_array_ptr(getterID, busVoltsID, 0);
+
+    while(1) {
+        if (xplra_multi_execute(getterID)<0) goto error;
+        printf("tail number: '%s', days: %d, zuluSec: %f\n",
+               tailnum, *days, *zuluSec);
+        printf("paused=%d, replay=%d, overspeed=%d, stalled=%d, onTheGround=%d\n",
+               *paused, *replay, *overspeed, *stalled, *onTheGround);
+        printf("emptyWeight=%f, payloadWeight=%f, grossWeight=%f\n",
+               *emptyWeight, *payloadWeight, *grossWeight);
+        printf("latitude=%f, longitude=%f, radioAltitude=%f, altitude=%f, gLoad=%f\n",
+               *latitude, *longitude, (*radioAltitude)/.3048, (*altitude)/.3048, *gLoad);
+        printf("heading=%f, pitch=%f, bank=%f, ias=%f, mach=%f, groundSpeed=%f, vs=%f\n",
+               *heading, *pitch, *bank, *ias, *mach, *groundSpeed, *vs);
+        printf("flapsControl=%f, flapsLeft=%f, flapsRight=%f\n",
+               *flapsControl, *flapsLeft, *flapsRight);
+        printf("Lights: NAV: %d, beacon: %d, strobe: %d, landing: %d\n",
+               *navLights, *beaconLights, *strobeLights, *landingLights);
+        printf("pitot: %d, parking: %f, gearControl: %d, noseGear: %f\n",
+               *pitot, *parking, *gearControl, *noseGear);
+        printf("altimeter: %f, qnh: %f\n",
+               *altimeter, *qnh);
+        printf("NAV types: %d %d %d %d %d %d\n",
+               navTypes[0], navTypes[1], navTypes[2],
+               navTypes[3], navTypes[4], navTypes[5]);
+        printf("bus voltages: %f %f %f %f\n",
+               busVolts[0], busVolts[1], busVolts[2], busVolts[3]);
+        printf("\n");
+#ifdef _WIN32
+        Sleep(1000);
+#else
+        usleep(1000*1000);
+#endif
+    }
+
+    goto cleanup;
+
+error:
+    errorString = xplra_get_last_error_string(connectionID);
+    if (errorString==0) {
+        printf("\nUnknown error occured!\n");
+    } else {
+        printf("\nError: %s\n", errorString);
+    }
+
+    retval = 1;
+
+cleanup:
+    if (connectionID>=0) xplra_disconnect(connectionID);
+    return retval;
+
+    // try {
+
+
+    //     while(true) {
+    //         getter.execute();
+    //         printf("tail number: '%s', days: %d, zuluSec: %f\n",
+    //                getter.getString(tailnumID).c_str(), days, zuluSec);
+    //         printf("paused=%d, replay=%d, overspeed=%d, stalled=%d, onTheGround=%d\n",
+    //                paused, replay, overspeed, stalled, onTheGround);
+    //         printf("emptyWeight=%f, payloadWeight=%f, grossWeight=%f\n",
+    //                emptyWeight, payloadWeight, grossWeight);
+    //         printf("latitude=%f, longitude=%f, radioAltitude=%f, altitude=%f, gLoad=%f\n",
+    //                latitude, longitude, radioAltitude/.3048, altitude/.3048, gLoad);
+    //         printf("heading=%f, pitch=%f, bank=%f, ias=%f, mach=%f, groundSpeed=%f, vs=%f\n",
+    //                heading, pitch,bank, ias, mach, groundSpeed, vs);
+    //         printf("flapsControl=%f, flapsLeft=%f, flapsRight=%f\n",
+    //                flapsControl, flapsLeft, flapsRight);
+    //         printf("Lights: NAV: %d, beacon: %d, strobe: %d, landing: %d\n",
+    //                navLights, beaconLights, strobeLights, landingLights);
+    //         printf("pitot: %d, parking: %f, gearControl: %d, noseGear: %f\n",
+    //                pitot, parking, gearControl, noseGear);
+    //         printf("altimeter: %f, qnh: %f\n",
+    //                altimeter, qnh);
+    //         printf("NAV types: %d %d %d %d %d %d\n",
+    //                navTypes[0], navTypes[1], navTypes[2],
+    //                navTypes[3], navTypes[4], navTypes[5]);
+    //         printf("bus voltages: %f %f %f %f\n",
+    //                busVolts[0], busVolts[1], busVolts[2], busVolts[3]);
+    //         printf("\n");
+    //         Thread::sleep(1000);
+    //     }
+
+    //     //xplane.destroyMultiBuffer(getter);
+
+    //     return 0;
+    // } catch(Exception& exception) {
+    //     printf("\n>>>>>>>>>>>>>>>>> Exception caugth: %s\n", exception.what());
+
+    //     return 1;
+    // }
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: test/multigetctest.c
===================================================================
--- test/multigetctest.c	(revision 41)
+++ 	(revision )
@@ -1,367 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of XPLRA, a remote-access plugin for X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include <hu/varadiistvan/xplra/xplra.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#ifdef _WIN32
-#include <windows.h>
-#else
-#include <unistd.h>
-#endif
-
-//------------------------------------------------------------------------------
-
-int main(int argc, char* argv[])
-{
-    int retval = 0;
-    const char* errorString;
-
-    int i;
-
-    int connectionID = -1;
-    int wrongGetterID = -1;
-    int getterID = -1;
-
-    size_t tailnumID = INVALID_DATAREF_ID;
-    size_t daysID = INVALID_DATAREF_ID;
-    size_t zuluSecID = INVALID_DATAREF_ID;
-    size_t pausedID = INVALID_DATAREF_ID;
-    size_t latitudeID = INVALID_DATAREF_ID;
-    size_t longitudeID = INVALID_DATAREF_ID;
-    size_t replayID = INVALID_DATAREF_ID;
-    size_t overspeedID = INVALID_DATAREF_ID;
-    size_t stalledID = INVALID_DATAREF_ID;
-    size_t onTheGroundID = INVALID_DATAREF_ID;
-    size_t emptyWeightID = INVALID_DATAREF_ID;
-    size_t payloadWeightID = INVALID_DATAREF_ID;
-    size_t grossWeightID = INVALID_DATAREF_ID;
-    size_t headingID = INVALID_DATAREF_ID;
-    size_t pitchID = INVALID_DATAREF_ID;
-    size_t bankID = INVALID_DATAREF_ID;
-    size_t iasID = INVALID_DATAREF_ID;
-    size_t machID = INVALID_DATAREF_ID;
-    size_t groundSpeedID = INVALID_DATAREF_ID;
-    size_t vsID = INVALID_DATAREF_ID;
-    size_t radioAltitudeID = INVALID_DATAREF_ID;
-    size_t altitudeID = INVALID_DATAREF_ID;
-    size_t gLoadID = INVALID_DATAREF_ID;
-    size_t flapsControlID = INVALID_DATAREF_ID;
-    size_t flapsLeftID = INVALID_DATAREF_ID;
-    size_t flapsRightID = INVALID_DATAREF_ID;
-    size_t navLightsID = INVALID_DATAREF_ID;
-    size_t beaconLightsID = INVALID_DATAREF_ID;
-    size_t strobeLightsID = INVALID_DATAREF_ID;
-    size_t landingLightsID = INVALID_DATAREF_ID;
-    size_t pitotID = INVALID_DATAREF_ID;
-    size_t parkingID = INVALID_DATAREF_ID;
-    size_t gearControlID = INVALID_DATAREF_ID;
-    size_t noseGearID = INVALID_DATAREF_ID;
-    size_t altimeterID = INVALID_DATAREF_ID;
-    size_t qnhID = INVALID_DATAREF_ID;
-    size_t navTypesID = INVALID_DATAREF_ID;
-    size_t busVoltsID = INVALID_DATAREF_ID;
-
-    const char* tailnum = 0;
-    const int32_t* days = 0;
-    const float* zuluSec = 0;
-    const int32_t* paused = 0;
-    const double* latitude = 0;
-    const double* longitude = 0;
-    const int32_t* replay = 0;
-    const int32_t* overspeed = 0;
-    const int32_t* stalled = 0;
-    const int32_t* onTheGround = 0;
-    const float* emptyWeight = 0;
-    const float* payloadWeight = 0;
-    const float* grossWeight = 0;
-    const float* heading = 0;
-    const float* pitch = 0;
-    const float* bank = 0;
-    const float* ias = 0;
-    const float* mach = 0;
-    const float* groundSpeed = 0;
-    const float* vs = 0;
-    const float* radioAltitude = 0;
-    const float* altitude = 0;
-    const float* gLoad = 0;
-    const float* flapsControl = 0;
-    const float* flapsLeft = 0;
-    const float* flapsRight = 0;
-    const int32_t* navLights = 0;
-    const int32_t* beaconLights = 0;
-    const int32_t* strobeLights = 0;
-    const int32_t* landingLights = 0;
-    const int32_t* pitot = 0;
-    const float* parking = 0;
-    const int32_t* gearControl = 0;
-    const float* noseGear = 0;
-    const float* altimeter = 0;
-    const float* qnh = 0;
-    const int32_t* navTypes = 0;
-    const float* busVolts = 0;
-
-    int dontregister = 0;
-
-    for(i = 1; i<argc; ++i) {
-        if (strcmp(argv[i], "dontregister")==0) {
-            dontregister = 1;
-        }
-    }
-
-    printf("Connecting to X-Plane...\n");
-    connectionID = xplra_connect();
-    if (connectionID>=0) {
-        printf("Connected to X-Plane.\n\n");
-    } else {
-        printf("Connection failed.\n\n");
-        goto cleanup;
-    }
-
-    wrongGetterID = xplra_multi_create_getter(connectionID);
-    if (wrongGetterID<0) goto error;
-    xplra_multi_add_int(wrongGetterID, "sim/time/local_date_days");
-    xplra_multi_add_int(wrongGetterID, "sim/time/paused");
-    xplra_multi_add_int(wrongGetterID, "sim/time/hello_te_lo");
-    xplra_multi_add_float(wrongGetterID, "sim/time/zulu_time_sec");
-    xplra_multi_add_int(wrongGetterID, "sim/operation/prefs/replay_mode");
-
-    printf("Executing a multi-dataref getter with an invalid dataref...\n");
-    if (xplra_multi_execute(wrongGetterID)<0) {
-        printf("Error occured: %s\n\n",
-               xplra_get_last_error_string(connectionID));
-        xplra_clear_last_error(connectionID);
-    } else {
-        printf(">>>>>>>>>>>>>>>>>>>>> Succeeded, but it should not have!!!!\n\n");
-    }
-
-    printf("Executing a registered multi-dataref getter with an invalid dataref...\n");
-    if (xplra_multi_register(wrongGetterID)<0) goto error;
-    if (xplra_multi_execute(wrongGetterID)<0) {
-        printf("Error occured: %s\n\n",
-               xplra_get_last_error_string(connectionID));
-        xplra_clear_last_error(connectionID);
-    } else {
-        printf(">>>>>>>>>>>>>>>>>>>>> Succeeded, but it should not have!!!!\n\n");
-    }
-
-
-    getterID = xplra_multi_create_getter(connectionID);
-    if (getterID<0) goto error;
-
-    tailnumID = xplra_multi_add_byte_array(getterID, "sim/aircraft/view/acf_tailnum", 40, 0);
-    daysID = xplra_multi_add_int(getterID, "sim/time/local_date_days");
-    zuluSecID = xplra_multi_add_float(getterID, "sim/time/zulu_time_sec");
-    pausedID = xplra_multi_add_int(getterID, "sim/time/paused");
-    latitudeID = xplra_multi_add_double(getterID, "sim/flightmodel/position/latitude");
-    longitudeID = xplra_multi_add_double(getterID, "sim/flightmodel/position/longitude");
-    replayID = xplra_multi_add_int(getterID, "sim/operation/prefs/replay_mode");
-    overspeedID = xplra_multi_add_int(getterID, "sim/flightmodel/failures/over_vne");
-    stalledID = xplra_multi_add_int(getterID, "sim/flightmodel/failures/stallwarning");
-    onTheGroundID = xplra_multi_add_int(getterID, "sim/flightmodel/failures/onground_any");
-    emptyWeightID = xplra_multi_add_float(getterID, "sim/aircraft/weight/acf_m_empty");
-    payloadWeightID = xplra_multi_add_float(getterID, "sim/flightmodel/weight/m_fixed");
-    grossWeightID = xplra_multi_add_float(getterID, "sim/flightmodel/weight/m_total");
-    headingID = xplra_multi_add_float(getterID, "sim/flightmodel/position/psi");
-    pitchID = xplra_multi_add_float(getterID, "sim/flightmodel/position/theta");
-    bankID = xplra_multi_add_float(getterID, "sim/flightmodel/position/phi");
-    iasID = xplra_multi_add_float(getterID, "sim/flightmodel/position/indicated_airspeed2");
-    machID = xplra_multi_add_float(getterID, "sim/flightmodel/misc/machno");
-    groundSpeedID = xplra_multi_add_float(getterID, "sim/flightmodel/position/groundspeed");
-    vsID = xplra_multi_add_float(getterID, "sim/flightmodel/position/vh_ind_fpm2");
-    radioAltitudeID = xplra_multi_add_float(getterID, "sim/flightmodel/position/y_agl");
-    altitudeID = xplra_multi_add_float(getterID, "sim/flightmodel/position/elevation");
-    gLoadID = xplra_multi_add_float(getterID, "sim/flightmodel/forces/g_nrml");
-    flapsControlID = xplra_multi_add_float(getterID, "sim/flightmodel/controls/flaprqst");
-    flapsLeftID = xplra_multi_add_float(getterID, "sim/flightmodel/controls/flaprat");
-    flapsRightID = xplra_multi_add_float(getterID, "sim/flightmodel/controls/flap2rat");
-    navLightsID = xplra_multi_add_int(getterID, "sim/cockpit/electrical/nav_lights_on");
-    beaconLightsID = xplra_multi_add_int(getterID, "sim/cockpit/electrical/beacon_lights_on");
-    strobeLightsID = xplra_multi_add_int(getterID, "sim/cockpit/electrical/strobe_lights_on");
-    landingLightsID = xplra_multi_add_int(getterID, "sim/cockpit/electrical/landing_lights_on");
-    pitotID = xplra_multi_add_int(getterID, "sim/cockpit/switches/pitot_heat_on");
-    parkingID = xplra_multi_add_float(getterID, "sim/flightmodel/controls/parkbrake");
-    gearControlID = xplra_multi_add_int(getterID, "sim/cockpit2/controls/gear_handle_down");
-    noseGearID = xplra_multi_add_float_array(getterID, "sim/flightmodel2/gear/deploy_ratio", 1, 0);
-    altimeterID = xplra_multi_add_float(getterID, "sim/cockpit/misc/barometer_setting");
-    qnhID = xplra_multi_add_float(getterID, "sim/flightmodel/misc/Qstatic");
-    navTypesID = xplra_multi_add_int_array(getterID, "sim/cockpit/radios/nav_type", 6, 0);
-    busVoltsID = xplra_multi_add_float_array(getterID, "sim/cockpit2/electrical/bus_volts", 4, 0);
-
-    if (dontregister) {
-        xplra_multi_finalize(getterID);
-    } else {
-        printf("Registering getter...\n");
-        if (xplra_multi_register(getterID)<0) goto error;
-        printf("Registered getter.\n\n");
-    }
-
-    tailnum = xplra_multi_get_string_ptr(getterID, tailnumID, 0);
-    days = xplra_multi_get_int_ptr(getterID, daysID);
-    zuluSec = xplra_multi_get_float_ptr(getterID, zuluSecID);
-    paused = xplra_multi_get_int_ptr(getterID, pausedID);
-    latitude = xplra_multi_get_double_ptr(getterID, latitudeID);
-    longitude = xplra_multi_get_double_ptr(getterID, longitudeID);
-    // frozen
-    // slew
-    replay = xplra_multi_get_int_ptr(getterID, replayID);
-    overspeed = xplra_multi_get_int_ptr(getterID, overspeedID);
-    stalled = xplra_multi_get_int_ptr(getterID, stalledID);
-    onTheGround = xplra_multi_get_int_ptr(getterID, onTheGroundID);
-    emptyWeight = xplra_multi_get_float_ptr(getterID, emptyWeightID);
-    payloadWeight = xplra_multi_get_float_ptr(getterID, payloadWeightID);
-    grossWeight = xplra_multi_get_float_ptr(getterID, grossWeightID);
-    heading = xplra_multi_get_float_ptr(getterID, headingID);
-    pitch = xplra_multi_get_float_ptr(getterID, pitchID);
-    bank = xplra_multi_get_float_ptr(getterID, bankID);
-    ias = xplra_multi_get_float_ptr(getterID, iasID);
-    mach = xplra_multi_get_float_ptr(getterID, machID);
-    groundSpeed = xplra_multi_get_float_ptr(getterID, groundSpeedID);
-    vs = xplra_multi_get_float_ptr(getterID, vsID);
-    radioAltitude = xplra_multi_get_float_ptr(getterID, radioAltitudeID);
-    altitude = xplra_multi_get_float_ptr(getterID, altitudeID);
-    gLoad = xplra_multi_get_float_ptr(getterID, gLoadID);
-    flapsControl = xplra_multi_get_float_ptr(getterID, flapsControlID);
-    flapsLeft = xplra_multi_get_float_ptr(getterID, flapsLeftID);
-    flapsRight = xplra_multi_get_float_ptr(getterID, flapsRightID);
-    navLights = xplra_multi_get_int_ptr(getterID, navLightsID);
-    beaconLights = xplra_multi_get_int_ptr(getterID, beaconLightsID);
-    strobeLights = xplra_multi_get_int_ptr(getterID, strobeLightsID);
-    landingLights = xplra_multi_get_int_ptr(getterID, landingLightsID);
-    pitot = xplra_multi_get_int_ptr(getterID, pitotID);
-    parking = xplra_multi_get_float_ptr(getterID, parkingID);
-    gearControl = xplra_multi_get_int_ptr(getterID, gearControlID);
-    noseGear = xplra_multi_get_float_array_ptr(getterID, noseGearID, 0);
-    altimeter = xplra_multi_get_float_ptr(getterID, altimeterID);
-    qnh = xplra_multi_get_float_ptr(getterID, qnhID);
-    navTypes = xplra_multi_get_int_array_ptr(getterID, navTypesID, 0);
-    busVolts = xplra_multi_get_float_array_ptr(getterID, busVoltsID, 0);
-
-    while(1) {
-        if (xplra_multi_execute(getterID)<0) goto error;
-        printf("tail number: '%s', days: %d, zuluSec: %f\n",
-               tailnum, *days, *zuluSec);
-        printf("paused=%d, replay=%d, overspeed=%d, stalled=%d, onTheGround=%d\n",
-               *paused, *replay, *overspeed, *stalled, *onTheGround);
-        printf("emptyWeight=%f, payloadWeight=%f, grossWeight=%f\n",
-               *emptyWeight, *payloadWeight, *grossWeight);
-        printf("latitude=%f, longitude=%f, radioAltitude=%f, altitude=%f, gLoad=%f\n",
-               *latitude, *longitude, (*radioAltitude)/.3048, (*altitude)/.3048, *gLoad);
-        printf("heading=%f, pitch=%f, bank=%f, ias=%f, mach=%f, groundSpeed=%f, vs=%f\n",
-               *heading, *pitch, *bank, *ias, *mach, *groundSpeed, *vs);
-        printf("flapsControl=%f, flapsLeft=%f, flapsRight=%f\n",
-               *flapsControl, *flapsLeft, *flapsRight);
-        printf("Lights: NAV: %d, beacon: %d, strobe: %d, landing: %d\n",
-               *navLights, *beaconLights, *strobeLights, *landingLights);
-        printf("pitot: %d, parking: %f, gearControl: %d, noseGear: %f\n",
-               *pitot, *parking, *gearControl, *noseGear);
-        printf("altimeter: %f, qnh: %f\n",
-               *altimeter, *qnh);
-        printf("NAV types: %d %d %d %d %d %d\n",
-               navTypes[0], navTypes[1], navTypes[2],
-               navTypes[3], navTypes[4], navTypes[5]);
-        printf("bus voltages: %f %f %f %f\n",
-               busVolts[0], busVolts[1], busVolts[2], busVolts[3]);
-        printf("\n");
-#ifdef _WIN32
-        Sleep(1000);
-#else
-        usleep(1000*1000);
-#endif
-    }
-
-    goto cleanup;
-
-error:
-    errorString = xplra_get_last_error_string(connectionID);
-    if (errorString==0) {
-        printf("\nUnknown error occured!\n");
-    } else {
-        printf("\nError: %s\n", errorString);
-    }
-
-    retval = 1;
-
-cleanup:
-    if (connectionID>=0) xplra_disconnect(connectionID);
-    return retval;
-
-    // try {
-
-
-    //     while(true) {
-    //         getter.execute();
-    //         printf("tail number: '%s', days: %d, zuluSec: %f\n",
-    //                getter.getString(tailnumID).c_str(), days, zuluSec);
-    //         printf("paused=%d, replay=%d, overspeed=%d, stalled=%d, onTheGround=%d\n",
-    //                paused, replay, overspeed, stalled, onTheGround);
-    //         printf("emptyWeight=%f, payloadWeight=%f, grossWeight=%f\n",
-    //                emptyWeight, payloadWeight, grossWeight);
-    //         printf("latitude=%f, longitude=%f, radioAltitude=%f, altitude=%f, gLoad=%f\n",
-    //                latitude, longitude, radioAltitude/.3048, altitude/.3048, gLoad);
-    //         printf("heading=%f, pitch=%f, bank=%f, ias=%f, mach=%f, groundSpeed=%f, vs=%f\n",
-    //                heading, pitch,bank, ias, mach, groundSpeed, vs);
-    //         printf("flapsControl=%f, flapsLeft=%f, flapsRight=%f\n",
-    //                flapsControl, flapsLeft, flapsRight);
-    //         printf("Lights: NAV: %d, beacon: %d, strobe: %d, landing: %d\n",
-    //                navLights, beaconLights, strobeLights, landingLights);
-    //         printf("pitot: %d, parking: %f, gearControl: %d, noseGear: %f\n",
-    //                pitot, parking, gearControl, noseGear);
-    //         printf("altimeter: %f, qnh: %f\n",
-    //                altimeter, qnh);
-    //         printf("NAV types: %d %d %d %d %d %d\n",
-    //                navTypes[0], navTypes[1], navTypes[2],
-    //                navTypes[3], navTypes[4], navTypes[5]);
-    //         printf("bus voltages: %f %f %f %f\n",
-    //                busVolts[0], busVolts[1], busVolts[2], busVolts[3]);
-    //         printf("\n");
-    //         Thread::sleep(1000);
-    //     }
-
-    //     //xplane.destroyMultiBuffer(getter);
-
-    //     return 0;
-    // } catch(Exception& exception) {
-    //     printf("\n>>>>>>>>>>>>>>>>> Exception caugth: %s\n", exception.what());
-
-    //     return 1;
-    // }
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: test/multigettest.cc
===================================================================
--- test/multigettest.cc	(revision 41)
+++ test/multigettest.cc	(revision 41)
@@ -0,0 +1,225 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of XPLRA, a remote-access plugin for X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include <hu/varadiistvan/xplra/XPlane.h>
+#include <hu/varadiistvan/xplra/MultiGetter.h>
+
+#include <hu/varadiistvan/scpl/Thread.h>
+
+#include <cstdio>
+#include <cstring>
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::xplra::XPlane;
+using hu::varadiistvan::xplra::MultiGetter;
+using hu::varadiistvan::xplra::Exception;
+using hu::varadiistvan::xplra::ProtocolException;
+
+using hu::varadiistvan::scpl::Thread;
+
+//------------------------------------------------------------------------------
+
+int main(int argc, char* argv[])
+{
+    bool dontregister = false;
+    for(int i = 1; i<argc; ++i) {
+        if (strcmp(argv[i], "dontregister")==0) {
+            dontregister = true;
+        }
+    }
+
+    try {
+        XPlane xplane;
+
+        printf("Connecting to X-Plane...\n");
+        xplane.connect();
+        printf("Connected to X-Plane.\n\n");
+
+        MultiGetter& wrongGetter = xplane.createMultiGetter();
+        wrongGetter.addInt("sim/time/local_date_days");
+        wrongGetter.addInt("sim/time/paused");
+        wrongGetter.addInt("sim/time/hello_te_lo");
+        wrongGetter.addFloat("sim/time/zulu_time_sec");
+        wrongGetter.addInt("sim/operation/prefs/replay_mode");
+
+        printf("Executing a multi-dataref getter with an invalid dataref...\n");
+        try {
+            wrongGetter.execute();
+            printf(">>>>>>>>>>>>>>>>>>>>> Succeeded, but it should not have!!!!\n\n");
+        } catch(const ProtocolException& e) {
+            printf("Caught protocol exception: %s\n\n", e.what());
+        }
+
+        printf("Executing a registered multi-dataref getter with an invalid dataref...\n");
+        wrongGetter.registerInXPlane();
+        try {
+            wrongGetter.execute();
+            printf(">>>>>>>>>>>>>>>>>>>>> Succeeded, but it should not have!!!!\n\n");
+        } catch(const ProtocolException& e) {
+            printf("Caught protocol exception: %s\n\n", e.what());
+        }
+
+        MultiGetter& getter = xplane.createMultiGetter();
+
+        const size_t tailnumID = getter.addByteArray("sim/aircraft/view/acf_tailnum", 40);
+        const size_t daysID = getter.addInt("sim/time/local_date_days");
+        const size_t zuluSecID = getter.addFloat("sim/time/zulu_time_sec");
+        const size_t pausedID = getter.addInt("sim/time/paused");
+        const size_t latitudeID = getter.addDouble("sim/flightmodel/position/latitude");
+        const size_t longitudeID = getter.addDouble("sim/flightmodel/position/longitude");
+        const size_t replayID = getter.addInt("sim/operation/prefs/replay_mode");
+        const size_t overspeedID = getter.addInt("sim/flightmodel/failures/over_vne");
+        const size_t stalledID = getter.addInt("sim/flightmodel/failures/stallwarning");
+        const size_t onTheGroundID = getter.addInt("sim/flightmodel/failures/onground_any");
+        const size_t emptyWeightID = getter.addFloat("sim/aircraft/weight/acf_m_empty");
+        const size_t payloadWeightID = getter.addFloat("sim/flightmodel/weight/m_fixed");
+        const size_t grossWeightID = getter.addFloat("sim/flightmodel/weight/m_total");
+        const size_t headingID = getter.addFloat("sim/flightmodel/position/psi");
+        const size_t pitchID = getter.addFloat("sim/flightmodel/position/theta");
+        const size_t bankID = getter.addFloat("sim/flightmodel/position/phi");
+        const size_t iasID = getter.addFloat("sim/flightmodel/position/indicated_airspeed2");
+        const size_t machID = getter.addFloat("sim/flightmodel/misc/machno");
+        const size_t groundSpeedID = getter.addFloat("sim/flightmodel/position/groundspeed");
+        const size_t vsID = getter.addFloat("sim/flightmodel/position/vh_ind_fpm2");
+        const size_t radioAltitudeID = getter.addFloat("sim/flightmodel/position/y_agl");
+        const size_t altitudeID = getter.addFloat("sim/flightmodel/position/elevation");
+        const size_t gLoadID = getter.addFloat("sim/flightmodel/forces/g_nrml");
+        const size_t flapsControlID = getter.addFloat("sim/flightmodel/controls/flaprqst");
+        const size_t flapsLeftID = getter.addFloat("sim/flightmodel/controls/flaprat");
+        const size_t flapsRightID = getter.addFloat("sim/flightmodel/controls/flap2rat");
+        const size_t navLightsID = getter.addInt("sim/cockpit/electrical/nav_lights_on");
+        const size_t beaconLightsID = getter.addInt("sim/cockpit/electrical/beacon_lights_on");
+        const size_t strobeLightsID = getter.addInt("sim/cockpit/electrical/strobe_lights_on");
+        const size_t landingLightsID = getter.addInt("sim/cockpit/electrical/landing_lights_on");
+        const size_t pitotID = getter.addInt("sim/cockpit/switches/pitot_heat_on");
+        const size_t parkingID = getter.addFloat("sim/flightmodel/controls/parkbrake");
+        //const size_t gearControlID = getter.addInt("sim/cockpit/switches/gear_handle_status");
+        const size_t gearControlID = getter.addInt("sim/cockpit2/controls/gear_handle_down");
+        const size_t noseGearID = getter.addFloatArray("sim/flightmodel2/gear/deploy_ratio", 1);
+        const size_t altimeterID = getter.addFloat("sim/cockpit/misc/barometer_setting");
+        const size_t qnhID = getter.addFloat("sim/flightmodel/misc/Qstatic");
+        const size_t navTypesID = getter.addIntArray("sim/cockpit/radios/nav_type", 6);
+        const size_t busVoltsID = getter.addFloatArray("sim/cockpit2/electrical/bus_volts", 4);
+
+        if (dontregister) {
+            getter.finalize();
+        } else {
+            printf("Registering getter...\n");
+            getter.registerInXPlane();
+            printf("Registered getter.\n\n");
+        }
+
+        const int32_t& days = getter.getIntRef(daysID);
+        const float& zuluSec = getter.getFloatRef(zuluSecID);
+        const int32_t& paused = getter.getIntRef(pausedID);
+        const double& latitude = getter.getDoubleRef(latitudeID);
+        const double& longitude = getter.getDoubleRef(longitudeID);
+        // frozen
+        // slew
+        const int32_t& replay = getter.getIntRef(replayID);
+        const int32_t& overspeed = getter.getIntRef(overspeedID);
+        const int32_t& stalled = getter.getIntRef(stalledID);
+        const int32_t& onTheGround = getter.getIntRef(onTheGroundID);
+        const float& emptyWeight = getter.getFloatRef(emptyWeightID);
+        const float& payloadWeight = getter.getFloatRef(payloadWeightID);
+        const float& grossWeight = getter.getFloatRef(grossWeightID);
+        const float& heading = getter.getFloatRef(headingID);
+        const float& pitch = getter.getFloatRef(pitchID);
+        const float& bank = getter.getFloatRef(bankID);
+        const float& ias = getter.getFloatRef(iasID);
+        const float& mach = getter.getFloatRef(machID);
+        const float& groundSpeed = getter.getFloatRef(groundSpeedID);
+        const float& vs = getter.getFloatRef(vsID);
+        const float& radioAltitude = getter.getFloatRef(radioAltitudeID);
+        const float& altitude = getter.getFloatRef(altitudeID);
+        const float& gLoad = getter.getFloatRef(gLoadID);
+        const float& flapsControl = getter.getFloatRef(flapsControlID);
+        const float& flapsLeft = getter.getFloatRef(flapsLeftID);
+        const float& flapsRight = getter.getFloatRef(flapsRightID);
+        const int32_t& navLights = getter.getIntRef(navLightsID);
+        const int32_t& beaconLights = getter.getIntRef(beaconLightsID);
+        const int32_t& strobeLights = getter.getIntRef(strobeLightsID);
+        const int32_t& landingLights = getter.getIntRef(landingLightsID);
+        const int32_t& pitot = getter.getIntRef(pitotID);
+        const float& parking = getter.getFloatRef(parkingID);
+        const int32_t& gearControl = getter.getIntRef(gearControlID);
+        const float& noseGear = getter.getFloatArray(noseGearID)[0];
+        const float& altimeter = getter.getFloatRef(altimeterID);
+        const float& qnh = getter.getFloatRef(qnhID);
+        const int32_t* navTypes = getter.getIntArray(navTypesID);
+        const float* busVolts = getter.getFloatArray(busVoltsID);
+
+        while(true) {
+            getter.execute();
+            printf("tail number: '%s', days: %d, zuluSec: %f\n",
+                   getter.getString(tailnumID).c_str(), days, zuluSec);
+            printf("paused=%d, replay=%d, overspeed=%d, stalled=%d, onTheGround=%d\n",
+                   paused, replay, overspeed, stalled, onTheGround);
+            printf("emptyWeight=%f, payloadWeight=%f, grossWeight=%f\n",
+                   emptyWeight, payloadWeight, grossWeight);
+            printf("latitude=%f, longitude=%f, radioAltitude=%f, altitude=%f, gLoad=%f\n",
+                   latitude, longitude, radioAltitude/.3048, altitude/.3048, gLoad);
+            printf("heading=%f, pitch=%f, bank=%f, ias=%f, mach=%f, groundSpeed=%f, vs=%f\n",
+                   heading, pitch,bank, ias, mach, groundSpeed, vs);
+            printf("flapsControl=%f, flapsLeft=%f, flapsRight=%f\n",
+                   flapsControl, flapsLeft, flapsRight);
+            printf("Lights: NAV: %d, beacon: %d, strobe: %d, landing: %d\n",
+                   navLights, beaconLights, strobeLights, landingLights);
+            printf("pitot: %d, parking: %f, gearControl: %d, noseGear: %f\n",
+                   pitot, parking, gearControl, noseGear);
+            printf("altimeter: %f, qnh: %f\n",
+                   altimeter, qnh);
+            printf("NAV types: %d %d %d %d %d %d\n",
+                   navTypes[0], navTypes[1], navTypes[2],
+                   navTypes[3], navTypes[4], navTypes[5]);
+            printf("bus voltages: %f %f %f %f\n",
+                   busVolts[0], busVolts[1], busVolts[2], busVolts[3]);
+            printf("\n");
+            Thread::sleep(1000);
+        }
+
+        //xplane.destroyMultiBuffer(getter);
+
+        return 0;
+    } catch(Exception& exception) {
+        printf("\n>>>>>>>>>>>>>>>>> Exception caugth: %s\n", exception.what());
+
+        return 1;
+    }
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: test/multigettest.cc
===================================================================
--- test/multigettest.cc	(revision 41)
+++ 	(revision )
@@ -1,225 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of XPLRA, a remote-access plugin for X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include <hu/varadiistvan/xplra/XPlane.h>
-#include <hu/varadiistvan/xplra/MultiGetter.h>
-
-#include <hu/varadiistvan/scpl/Thread.h>
-
-#include <cstdio>
-#include <cstring>
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::xplra::XPlane;
-using hu::varadiistvan::xplra::MultiGetter;
-using hu::varadiistvan::xplra::Exception;
-using hu::varadiistvan::xplra::ProtocolException;
-
-using hu::varadiistvan::scpl::Thread;
-
-//------------------------------------------------------------------------------
-
-int main(int argc, char* argv[])
-{
-    bool dontregister = false;
-    for(int i = 1; i<argc; ++i) {
-        if (strcmp(argv[i], "dontregister")==0) {
-            dontregister = true;
-        }
-    }
-
-    try {
-        XPlane xplane;
-
-        printf("Connecting to X-Plane...\n");
-        xplane.connect();
-        printf("Connected to X-Plane.\n\n");
-
-        MultiGetter& wrongGetter = xplane.createMultiGetter();
-        wrongGetter.addInt("sim/time/local_date_days");
-        wrongGetter.addInt("sim/time/paused");
-        wrongGetter.addInt("sim/time/hello_te_lo");
-        wrongGetter.addFloat("sim/time/zulu_time_sec");
-        wrongGetter.addInt("sim/operation/prefs/replay_mode");
-
-        printf("Executing a multi-dataref getter with an invalid dataref...\n");
-        try {
-            wrongGetter.execute();
-            printf(">>>>>>>>>>>>>>>>>>>>> Succeeded, but it should not have!!!!\n\n");
-        } catch(const ProtocolException& e) {
-            printf("Caught protocol exception: %s\n\n", e.what());
-        }
-
-        printf("Executing a registered multi-dataref getter with an invalid dataref...\n");
-        wrongGetter.registerInXPlane();
-        try {
-            wrongGetter.execute();
-            printf(">>>>>>>>>>>>>>>>>>>>> Succeeded, but it should not have!!!!\n\n");
-        } catch(const ProtocolException& e) {
-            printf("Caught protocol exception: %s\n\n", e.what());
-        }
-
-        MultiGetter& getter = xplane.createMultiGetter();
-
-        const size_t tailnumID = getter.addByteArray("sim/aircraft/view/acf_tailnum", 40);
-        const size_t daysID = getter.addInt("sim/time/local_date_days");
-        const size_t zuluSecID = getter.addFloat("sim/time/zulu_time_sec");
-        const size_t pausedID = getter.addInt("sim/time/paused");
-        const size_t latitudeID = getter.addDouble("sim/flightmodel/position/latitude");
-        const size_t longitudeID = getter.addDouble("sim/flightmodel/position/longitude");
-        const size_t replayID = getter.addInt("sim/operation/prefs/replay_mode");
-        const size_t overspeedID = getter.addInt("sim/flightmodel/failures/over_vne");
-        const size_t stalledID = getter.addInt("sim/flightmodel/failures/stallwarning");
-        const size_t onTheGroundID = getter.addInt("sim/flightmodel/failures/onground_any");
-        const size_t emptyWeightID = getter.addFloat("sim/aircraft/weight/acf_m_empty");
-        const size_t payloadWeightID = getter.addFloat("sim/flightmodel/weight/m_fixed");
-        const size_t grossWeightID = getter.addFloat("sim/flightmodel/weight/m_total");
-        const size_t headingID = getter.addFloat("sim/flightmodel/position/psi");
-        const size_t pitchID = getter.addFloat("sim/flightmodel/position/theta");
-        const size_t bankID = getter.addFloat("sim/flightmodel/position/phi");
-        const size_t iasID = getter.addFloat("sim/flightmodel/position/indicated_airspeed2");
-        const size_t machID = getter.addFloat("sim/flightmodel/misc/machno");
-        const size_t groundSpeedID = getter.addFloat("sim/flightmodel/position/groundspeed");
-        const size_t vsID = getter.addFloat("sim/flightmodel/position/vh_ind_fpm2");
-        const size_t radioAltitudeID = getter.addFloat("sim/flightmodel/position/y_agl");
-        const size_t altitudeID = getter.addFloat("sim/flightmodel/position/elevation");
-        const size_t gLoadID = getter.addFloat("sim/flightmodel/forces/g_nrml");
-        const size_t flapsControlID = getter.addFloat("sim/flightmodel/controls/flaprqst");
-        const size_t flapsLeftID = getter.addFloat("sim/flightmodel/controls/flaprat");
-        const size_t flapsRightID = getter.addFloat("sim/flightmodel/controls/flap2rat");
-        const size_t navLightsID = getter.addInt("sim/cockpit/electrical/nav_lights_on");
-        const size_t beaconLightsID = getter.addInt("sim/cockpit/electrical/beacon_lights_on");
-        const size_t strobeLightsID = getter.addInt("sim/cockpit/electrical/strobe_lights_on");
-        const size_t landingLightsID = getter.addInt("sim/cockpit/electrical/landing_lights_on");
-        const size_t pitotID = getter.addInt("sim/cockpit/switches/pitot_heat_on");
-        const size_t parkingID = getter.addFloat("sim/flightmodel/controls/parkbrake");
-        //const size_t gearControlID = getter.addInt("sim/cockpit/switches/gear_handle_status");
-        const size_t gearControlID = getter.addInt("sim/cockpit2/controls/gear_handle_down");
-        const size_t noseGearID = getter.addFloatArray("sim/flightmodel2/gear/deploy_ratio", 1);
-        const size_t altimeterID = getter.addFloat("sim/cockpit/misc/barometer_setting");
-        const size_t qnhID = getter.addFloat("sim/flightmodel/misc/Qstatic");
-        const size_t navTypesID = getter.addIntArray("sim/cockpit/radios/nav_type", 6);
-        const size_t busVoltsID = getter.addFloatArray("sim/cockpit2/electrical/bus_volts", 4);
-
-        if (dontregister) {
-            getter.finalize();
-        } else {
-            printf("Registering getter...\n");
-            getter.registerInXPlane();
-            printf("Registered getter.\n\n");
-        }
-
-        const int32_t& days = getter.getIntRef(daysID);
-        const float& zuluSec = getter.getFloatRef(zuluSecID);
-        const int32_t& paused = getter.getIntRef(pausedID);
-        const double& latitude = getter.getDoubleRef(latitudeID);
-        const double& longitude = getter.getDoubleRef(longitudeID);
-        // frozen
-        // slew
-        const int32_t& replay = getter.getIntRef(replayID);
-        const int32_t& overspeed = getter.getIntRef(overspeedID);
-        const int32_t& stalled = getter.getIntRef(stalledID);
-        const int32_t& onTheGround = getter.getIntRef(onTheGroundID);
-        const float& emptyWeight = getter.getFloatRef(emptyWeightID);
-        const float& payloadWeight = getter.getFloatRef(payloadWeightID);
-        const float& grossWeight = getter.getFloatRef(grossWeightID);
-        const float& heading = getter.getFloatRef(headingID);
-        const float& pitch = getter.getFloatRef(pitchID);
-        const float& bank = getter.getFloatRef(bankID);
-        const float& ias = getter.getFloatRef(iasID);
-        const float& mach = getter.getFloatRef(machID);
-        const float& groundSpeed = getter.getFloatRef(groundSpeedID);
-        const float& vs = getter.getFloatRef(vsID);
-        const float& radioAltitude = getter.getFloatRef(radioAltitudeID);
-        const float& altitude = getter.getFloatRef(altitudeID);
-        const float& gLoad = getter.getFloatRef(gLoadID);
-        const float& flapsControl = getter.getFloatRef(flapsControlID);
-        const float& flapsLeft = getter.getFloatRef(flapsLeftID);
-        const float& flapsRight = getter.getFloatRef(flapsRightID);
-        const int32_t& navLights = getter.getIntRef(navLightsID);
-        const int32_t& beaconLights = getter.getIntRef(beaconLightsID);
-        const int32_t& strobeLights = getter.getIntRef(strobeLightsID);
-        const int32_t& landingLights = getter.getIntRef(landingLightsID);
-        const int32_t& pitot = getter.getIntRef(pitotID);
-        const float& parking = getter.getFloatRef(parkingID);
-        const int32_t& gearControl = getter.getIntRef(gearControlID);
-        const float& noseGear = getter.getFloatArray(noseGearID)[0];
-        const float& altimeter = getter.getFloatRef(altimeterID);
-        const float& qnh = getter.getFloatRef(qnhID);
-        const int32_t* navTypes = getter.getIntArray(navTypesID);
-        const float* busVolts = getter.getFloatArray(busVoltsID);
-
-        while(true) {
-            getter.execute();
-            printf("tail number: '%s', days: %d, zuluSec: %f\n",
-                   getter.getString(tailnumID).c_str(), days, zuluSec);
-            printf("paused=%d, replay=%d, overspeed=%d, stalled=%d, onTheGround=%d\n",
-                   paused, replay, overspeed, stalled, onTheGround);
-            printf("emptyWeight=%f, payloadWeight=%f, grossWeight=%f\n",
-                   emptyWeight, payloadWeight, grossWeight);
-            printf("latitude=%f, longitude=%f, radioAltitude=%f, altitude=%f, gLoad=%f\n",
-                   latitude, longitude, radioAltitude/.3048, altitude/.3048, gLoad);
-            printf("heading=%f, pitch=%f, bank=%f, ias=%f, mach=%f, groundSpeed=%f, vs=%f\n",
-                   heading, pitch,bank, ias, mach, groundSpeed, vs);
-            printf("flapsControl=%f, flapsLeft=%f, flapsRight=%f\n",
-                   flapsControl, flapsLeft, flapsRight);
-            printf("Lights: NAV: %d, beacon: %d, strobe: %d, landing: %d\n",
-                   navLights, beaconLights, strobeLights, landingLights);
-            printf("pitot: %d, parking: %f, gearControl: %d, noseGear: %f\n",
-                   pitot, parking, gearControl, noseGear);
-            printf("altimeter: %f, qnh: %f\n",
-                   altimeter, qnh);
-            printf("NAV types: %d %d %d %d %d %d\n",
-                   navTypes[0], navTypes[1], navTypes[2],
-                   navTypes[3], navTypes[4], navTypes[5]);
-            printf("bus voltages: %f %f %f %f\n",
-                   busVolts[0], busVolts[1], busVolts[2], busVolts[3]);
-            printf("\n");
-            Thread::sleep(1000);
-        }
-
-        //xplane.destroyMultiBuffer(getter);
-
-        return 0;
-    } catch(Exception& exception) {
-        printf("\n>>>>>>>>>>>>>>>>> Exception caugth: %s\n", exception.what());
-
-        return 1;
-    }
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: test/multigettest.py
===================================================================
--- test/multigettest.py	(revision 41)
+++ test/multigettest.py	(revision 41)
@@ -0,0 +1,130 @@
+# Multi-dataref query test program for the Python client library
+
+#------------------------------------------------------------------------------
+
+if __name__ == "__main__":
+    import sys
+    import time
+    from xplra import XPlane, ProtocolException
+
+    xplane = XPlane()
+
+    dontregister = "dontregister" in sys.argv
+
+    try:
+        print "Connecting to X-Plane..."
+        xplane.connect()
+        print "Connected to X-Plane."
+        print
+
+        wrongGetter = xplane.createMultiGetter();
+        wrongGetter.addInt("sim/time/local_date_days");
+        wrongGetter.addInt("sim/time/paused");
+        wrongGetter.addInt("sim/time/hello_te_lo");
+        wrongGetter.addFloat("sim/time/zulu_time_sec");
+        wrongGetter.addInt("sim/operation/prefs/replay_mode");
+
+        print "Executing a multi-dataref getter with an invalid dataref..."
+        try:
+            wrongGetter.execute();
+            print ">>>>>>>>>>>>>>>>>>>>> Succeeded, but it should not have!!!!"
+        except ProtocolException, e:
+            print "Caught protocol exception: " + str(e)
+        print
+
+        print "Executing a registered multi-dataref getter with an invalid dataref..."
+        wrongGetter.register()
+        try:
+            wrongGetter.execute();
+            print ">>>>>>>>>>>>>>>>>>>>> Succeeded, but it should not have!!!!"
+        except ProtocolException, e:
+            print "Caught protocol exception: " + str(e)
+        print
+
+        getter = xplane.createMultiGetter()
+
+        tailnumID = getter.addByteArray("sim/aircraft/view/acf_tailnum", 40)
+        daysID = getter.addInt("sim/time/local_date_days")
+        zuluSecID = getter.addFloat("sim/time/zulu_time_sec")
+        pausedID = getter.addInt("sim/time/paused")
+        latitudeID = getter.addDouble("sim/flightmodel/position/latitude")
+        longitudeID = getter.addDouble("sim/flightmodel/position/longitude")
+        replayID = getter.addInt("sim/operation/prefs/replay_mode")
+        overspeedID = getter.addInt("sim/flightmodel/failures/over_vne")
+        stalledID = getter.addInt("sim/flightmodel/failures/stallwarning")
+        onTheGroundID = getter.addInt("sim/flightmodel/failures/onground_any")
+        emptyWeightID = getter.addFloat("sim/aircraft/weight/acf_m_empty")
+        payloadWeightID = getter.addFloat("sim/flightmodel/weight/m_fixed")
+        grossWeightID = getter.addFloat("sim/flightmodel/weight/m_total")
+        headingID = getter.addFloat("sim/flightmodel/position/psi")
+        pitchID = getter.addFloat("sim/flightmodel/position/theta")
+        bankID = getter.addFloat("sim/flightmodel/position/phi")
+        iasID = getter.addFloat("sim/flightmodel/position/indicated_airspeed2")
+        machID = getter.addFloat("sim/flightmodel/misc/machno")
+        groundSpeedID = getter.addFloat("sim/flightmodel/position/groundspeed")
+        vsID = getter.addFloat("sim/flightmodel/position/vh_ind_fpm2")
+        radioAltitudeID = getter.addFloat("sim/flightmodel/position/y_agl")
+        altitudeID = getter.addFloat("sim/flightmodel/position/elevation")
+        gLoadID = getter.addFloat("sim/flightmodel/forces/g_nrml")
+        flapsControlID = getter.addFloat("sim/flightmodel/controls/flaprqst")
+        flapsLeftID = getter.addFloat("sim/flightmodel/controls/flaprat")
+        flapsRightID = getter.addFloat("sim/flightmodel/controls/flap2rat")
+        navLightsID = getter.addInt("sim/cockpit/electrical/nav_lights_on")
+        beaconLightsID = getter.addInt("sim/cockpit/electrical/beacon_lights_on")
+        strobeLightsID = getter.addInt("sim/cockpit/electrical/strobe_lights_on")
+        landingLightsID = getter.addInt("sim/cockpit/electrical/landing_lights_on")
+        pitotID = getter.addInt("sim/cockpit/switches/pitot_heat_on")
+        parkingID = getter.addFloat("sim/flightmodel/controls/parkbrake")
+        gearControlID = getter.addInt("sim/cockpit2/controls/gear_handle_down")
+        noseGearID = getter.addFloatArray("sim/flightmodel2/gear/deploy_ratio", 1)
+        altimeterID = getter.addFloat("sim/cockpit/misc/barometer_setting")
+        qnhID = getter.addFloat("sim/flightmodel/misc/Qstatic")
+        navTypesID = getter.addIntArray("sim/cockpit/radios/nav_type", 6)
+        busVoltsID = getter.addFloatArray("sim/cockpit2/electrical/bus_volts", 4)
+
+        if dontregister:
+            getter.finalize()
+        else:
+            print "Registering getter..."
+            getter.register()
+            print "Registered getter."
+            print
+
+        while True:
+            getter.execute()
+            print "tail number: '%s', days: %d, zuluSec: %f" % \
+                (getter.getString(tailnumID), getter[daysID], getter[zuluSecID])
+            print "paused=%d, replay=%d, overspeed=%d, stalled=%d, onTheGround=%d" % \
+                (getter[pausedID], getter[replayID], getter[overspeedID],
+                 getter[stalledID], getter[onTheGroundID])
+            print "emptyWeight=%f, payloadWeight=%f, grossWeight=%f" % \
+                (getter[emptyWeightID], getter[payloadWeightID],
+                 getter[grossWeightID])
+            print "latitude=%f, longitude=%f, radioAltitude=%f, altitude=%f, gLoad=%f" % \
+                (getter[latitudeID], getter[longitudeID],
+                 getter[radioAltitudeID]/.3048, getter[altitudeID]/.3048,
+                 getter[gLoadID])
+            print "heading=%f, pitch=%f, bank=%f, ias=%f, mach=%f, groundSpeed=%f, vs=%f" % \
+                (getter[headingID], getter[pitchID], getter[bankID],
+                 getter[iasID], getter[machID], getter[groundSpeedID],
+                 getter[vsID]);
+            print "flapsControl=%f, flapsLeft=%f, flapsRight=%f" % \
+                (getter[flapsControlID], getter[flapsLeftID],
+                 getter[flapsRightID]);
+            print "Lights: NAV: %d, beacon: %d, strobe: %d, landing: %d" % \
+                (getter[navLightsID], getter[beaconLightsID],
+                 getter[strobeLightsID], getter[landingLightsID]);
+            print "pitot: %d, parking: %f, gearControl: %d, noseGear: %f" % \
+                (getter[pitotID], getter[parkingID],
+                 getter[gearControlID], getter[noseGearID][0]);
+            print "altimeter: %f, qnh: %f" % \
+                (getter[altimeterID], getter[qnhID]);
+            print "NAV types:", getter[navTypesID]
+            print "bus voltages:", getter[busVoltsID]
+            print
+            time.sleep(1.0)
+
+    except Exception as e:
+        print ">>>>>>>>>>>>>>>>>>>>>> Exception caught:", str(e)
+    finally:
+        xplane.disconnect()
Index: test/multigettest.py
===================================================================
--- test/multigettest.py	(revision 41)
+++ 	(revision )
@@ -1,130 +1,0 @@
-# Multi-dataref query test program for the Python client library
-
-#------------------------------------------------------------------------------
-
-if __name__ == "__main__":
-    import sys
-    import time
-    from xplra import XPlane, ProtocolException
-
-    xplane = XPlane()
-
-    dontregister = "dontregister" in sys.argv
-
-    try:
-        print "Connecting to X-Plane..."
-        xplane.connect()
-        print "Connected to X-Plane."
-        print
-
-        wrongGetter = xplane.createMultiGetter();
-        wrongGetter.addInt("sim/time/local_date_days");
-        wrongGetter.addInt("sim/time/paused");
-        wrongGetter.addInt("sim/time/hello_te_lo");
-        wrongGetter.addFloat("sim/time/zulu_time_sec");
-        wrongGetter.addInt("sim/operation/prefs/replay_mode");
-
-        print "Executing a multi-dataref getter with an invalid dataref..."
-        try:
-            wrongGetter.execute();
-            print ">>>>>>>>>>>>>>>>>>>>> Succeeded, but it should not have!!!!"
-        except ProtocolException, e:
-            print "Caught protocol exception: " + str(e)
-        print
-
-        print "Executing a registered multi-dataref getter with an invalid dataref..."
-        wrongGetter.register()
-        try:
-            wrongGetter.execute();
-            print ">>>>>>>>>>>>>>>>>>>>> Succeeded, but it should not have!!!!"
-        except ProtocolException, e:
-            print "Caught protocol exception: " + str(e)
-        print
-
-        getter = xplane.createMultiGetter()
-
-        tailnumID = getter.addByteArray("sim/aircraft/view/acf_tailnum", 40)
-        daysID = getter.addInt("sim/time/local_date_days")
-        zuluSecID = getter.addFloat("sim/time/zulu_time_sec")
-        pausedID = getter.addInt("sim/time/paused")
-        latitudeID = getter.addDouble("sim/flightmodel/position/latitude")
-        longitudeID = getter.addDouble("sim/flightmodel/position/longitude")
-        replayID = getter.addInt("sim/operation/prefs/replay_mode")
-        overspeedID = getter.addInt("sim/flightmodel/failures/over_vne")
-        stalledID = getter.addInt("sim/flightmodel/failures/stallwarning")
-        onTheGroundID = getter.addInt("sim/flightmodel/failures/onground_any")
-        emptyWeightID = getter.addFloat("sim/aircraft/weight/acf_m_empty")
-        payloadWeightID = getter.addFloat("sim/flightmodel/weight/m_fixed")
-        grossWeightID = getter.addFloat("sim/flightmodel/weight/m_total")
-        headingID = getter.addFloat("sim/flightmodel/position/psi")
-        pitchID = getter.addFloat("sim/flightmodel/position/theta")
-        bankID = getter.addFloat("sim/flightmodel/position/phi")
-        iasID = getter.addFloat("sim/flightmodel/position/indicated_airspeed2")
-        machID = getter.addFloat("sim/flightmodel/misc/machno")
-        groundSpeedID = getter.addFloat("sim/flightmodel/position/groundspeed")
-        vsID = getter.addFloat("sim/flightmodel/position/vh_ind_fpm2")
-        radioAltitudeID = getter.addFloat("sim/flightmodel/position/y_agl")
-        altitudeID = getter.addFloat("sim/flightmodel/position/elevation")
-        gLoadID = getter.addFloat("sim/flightmodel/forces/g_nrml")
-        flapsControlID = getter.addFloat("sim/flightmodel/controls/flaprqst")
-        flapsLeftID = getter.addFloat("sim/flightmodel/controls/flaprat")
-        flapsRightID = getter.addFloat("sim/flightmodel/controls/flap2rat")
-        navLightsID = getter.addInt("sim/cockpit/electrical/nav_lights_on")
-        beaconLightsID = getter.addInt("sim/cockpit/electrical/beacon_lights_on")
-        strobeLightsID = getter.addInt("sim/cockpit/electrical/strobe_lights_on")
-        landingLightsID = getter.addInt("sim/cockpit/electrical/landing_lights_on")
-        pitotID = getter.addInt("sim/cockpit/switches/pitot_heat_on")
-        parkingID = getter.addFloat("sim/flightmodel/controls/parkbrake")
-        gearControlID = getter.addInt("sim/cockpit2/controls/gear_handle_down")
-        noseGearID = getter.addFloatArray("sim/flightmodel2/gear/deploy_ratio", 1)
-        altimeterID = getter.addFloat("sim/cockpit/misc/barometer_setting")
-        qnhID = getter.addFloat("sim/flightmodel/misc/Qstatic")
-        navTypesID = getter.addIntArray("sim/cockpit/radios/nav_type", 6)
-        busVoltsID = getter.addFloatArray("sim/cockpit2/electrical/bus_volts", 4)
-
-        if dontregister:
-            getter.finalize()
-        else:
-            print "Registering getter..."
-            getter.register()
-            print "Registered getter."
-            print
-
-        while True:
-            getter.execute()
-            print "tail number: '%s', days: %d, zuluSec: %f" % \
-                (getter.getString(tailnumID), getter[daysID], getter[zuluSecID])
-            print "paused=%d, replay=%d, overspeed=%d, stalled=%d, onTheGround=%d" % \
-                (getter[pausedID], getter[replayID], getter[overspeedID],
-                 getter[stalledID], getter[onTheGroundID])
-            print "emptyWeight=%f, payloadWeight=%f, grossWeight=%f" % \
-                (getter[emptyWeightID], getter[payloadWeightID],
-                 getter[grossWeightID])
-            print "latitude=%f, longitude=%f, radioAltitude=%f, altitude=%f, gLoad=%f" % \
-                (getter[latitudeID], getter[longitudeID],
-                 getter[radioAltitudeID]/.3048, getter[altitudeID]/.3048,
-                 getter[gLoadID])
-            print "heading=%f, pitch=%f, bank=%f, ias=%f, mach=%f, groundSpeed=%f, vs=%f" % \
-                (getter[headingID], getter[pitchID], getter[bankID],
-                 getter[iasID], getter[machID], getter[groundSpeedID],
-                 getter[vsID]);
-            print "flapsControl=%f, flapsLeft=%f, flapsRight=%f" % \
-                (getter[flapsControlID], getter[flapsLeftID],
-                 getter[flapsRightID]);
-            print "Lights: NAV: %d, beacon: %d, strobe: %d, landing: %d" % \
-                (getter[navLightsID], getter[beaconLightsID],
-                 getter[strobeLightsID], getter[landingLightsID]);
-            print "pitot: %d, parking: %f, gearControl: %d, noseGear: %f" % \
-                (getter[pitotID], getter[parkingID],
-                 getter[gearControlID], getter[noseGearID][0]);
-            print "altimeter: %f, qnh: %f" % \
-                (getter[altimeterID], getter[qnhID]);
-            print "NAV types:", getter[navTypesID]
-            print "bus voltages:", getter[busVoltsID]
-            print
-            time.sleep(1.0)
-
-    except Exception as e:
-        print ">>>>>>>>>>>>>>>>>>>>>> Exception caught:", str(e)
-    finally:
-        xplane.disconnect()
Index: test/multisetctest.c
===================================================================
--- test/multisetctest.c	(revision 30)
+++ test/multisetctest.c	(revision 30)
@@ -0,0 +1,132 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of XPLRA, a remote-access plugin for X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include <hu/varadiistvan/xplra/xplra.h>
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+//------------------------------------------------------------------------------
+
+int main(int argc, char* argv[])
+{
+    int retval = 0;
+    const char* errorString;
+
+    int i;
+
+    int connectionID = -1;
+    int setterID = -1;
+
+    size_t simSpeedID = INVALID_DATAREF_ID;
+    size_t zuluSecID = INVALID_DATAREF_ID;
+    size_t localXID = INVALID_DATAREF_ID;
+    size_t tailNumID = INVALID_DATAREF_ID;
+    size_t generatorOnID = INVALID_DATAREF_ID;
+    size_t propPitchID = INVALID_DATAREF_ID;
+
+    int32_t generatorOn[8] = { 1, 0, 1, 0, 1, 0, 1, 0 };
+    float propPitch[2] = { 32.4, 78.2 };
+
+    int dontregister = 0;
+
+    for(i = 1; i<argc; ++i) {
+        if (strcmp(argv[i], "dontregister")==0) {
+            dontregister = 1;
+        }
+    }
+
+    printf("Connecting to X-Plane...\n");
+    connectionID = xplra_connect();
+    if (connectionID>=0) {
+        printf("Connected to X-Plane.\n\n");
+    } else {
+        printf("Connection failed.\n\n");
+        goto cleanup;
+    }
+
+    setterID = xplra_multi_create_setter(connectionID);
+    if (setterID<0) goto error;
+
+    simSpeedID = xplra_multi_add_int(setterID, "sim/time/sim_speed");
+    zuluSecID = xplra_multi_add_float(setterID, "sim/time/zulu_time_sec");
+    localXID = xplra_multi_add_double(setterID, "sim/flightmodel/position/local_x");
+    tailNumID = xplra_multi_add_byte_array(setterID, "sim/aircraft/view/acf_tailnum", 40, 0);
+    generatorOnID = xplra_multi_add_int_array(setterID, "sim/cockpit/electrical/generator_on", 8, 0);
+    propPitchID = xplra_multi_add_float_array(setterID, "sim/cockpit2/engine/actuators/prop_pitch_deg", 2, 0);
+
+    if (dontregister) {
+        xplra_multi_finalize(setterID);
+    } else {
+        printf("Registering getter...\n");
+        if (xplra_multi_register(setterID)<0) goto error;
+        printf("Registered getter.\n\n");
+    }
+
+    printf("Setting values...\n");
+
+    xplra_multi_set_int(setterID, simSpeedID, 0);
+    xplra_multi_set_float(setterID, zuluSecID, 7265.0);
+    xplra_multi_set_double(setterID, localXID, 12.0);
+    xplra_multi_set_string(setterID, tailNumID, "Kukutyin", 0);
+    xplra_multi_set_int_array(setterID, generatorOnID, generatorOn, 8, 0);
+    xplra_multi_set_float_array(setterID, propPitchID, propPitch, 2, 0);
+
+    printf("Executing...\n");
+
+    if (xplra_multi_execute(setterID)<0) goto error;
+
+    printf("Done.\n");
+
+    goto cleanup;
+
+error:
+    errorString = xplra_get_last_error_string(connectionID);
+    if (errorString==0) {
+        printf("\nUnknown error occured!\n");
+    } else {
+        printf("\nError: %s\n", errorString);
+    }
+
+    retval = 1;
+
+cleanup:
+    if (connectionID>=0) xplra_disconnect(connectionID);
+    return retval;
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: test/multisetctest.c
===================================================================
--- test/multisetctest.c	(revision 30)
+++ 	(revision )
@@ -1,132 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of XPLRA, a remote-access plugin for X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include <hu/varadiistvan/xplra/xplra.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-//------------------------------------------------------------------------------
-
-int main(int argc, char* argv[])
-{
-    int retval = 0;
-    const char* errorString;
-
-    int i;
-
-    int connectionID = -1;
-    int setterID = -1;
-
-    size_t simSpeedID = INVALID_DATAREF_ID;
-    size_t zuluSecID = INVALID_DATAREF_ID;
-    size_t localXID = INVALID_DATAREF_ID;
-    size_t tailNumID = INVALID_DATAREF_ID;
-    size_t generatorOnID = INVALID_DATAREF_ID;
-    size_t propPitchID = INVALID_DATAREF_ID;
-
-    int32_t generatorOn[8] = { 1, 0, 1, 0, 1, 0, 1, 0 };
-    float propPitch[2] = { 32.4, 78.2 };
-
-    int dontregister = 0;
-
-    for(i = 1; i<argc; ++i) {
-        if (strcmp(argv[i], "dontregister")==0) {
-            dontregister = 1;
-        }
-    }
-
-    printf("Connecting to X-Plane...\n");
-    connectionID = xplra_connect();
-    if (connectionID>=0) {
-        printf("Connected to X-Plane.\n\n");
-    } else {
-        printf("Connection failed.\n\n");
-        goto cleanup;
-    }
-
-    setterID = xplra_multi_create_setter(connectionID);
-    if (setterID<0) goto error;
-
-    simSpeedID = xplra_multi_add_int(setterID, "sim/time/sim_speed");
-    zuluSecID = xplra_multi_add_float(setterID, "sim/time/zulu_time_sec");
-    localXID = xplra_multi_add_double(setterID, "sim/flightmodel/position/local_x");
-    tailNumID = xplra_multi_add_byte_array(setterID, "sim/aircraft/view/acf_tailnum", 40, 0);
-    generatorOnID = xplra_multi_add_int_array(setterID, "sim/cockpit/electrical/generator_on", 8, 0);
-    propPitchID = xplra_multi_add_float_array(setterID, "sim/cockpit2/engine/actuators/prop_pitch_deg", 2, 0);
-
-    if (dontregister) {
-        xplra_multi_finalize(setterID);
-    } else {
-        printf("Registering getter...\n");
-        if (xplra_multi_register(setterID)<0) goto error;
-        printf("Registered getter.\n\n");
-    }
-
-    printf("Setting values...\n");
-
-    xplra_multi_set_int(setterID, simSpeedID, 0);
-    xplra_multi_set_float(setterID, zuluSecID, 7265.0);
-    xplra_multi_set_double(setterID, localXID, 12.0);
-    xplra_multi_set_string(setterID, tailNumID, "Kukutyin", 0);
-    xplra_multi_set_int_array(setterID, generatorOnID, generatorOn, 8, 0);
-    xplra_multi_set_float_array(setterID, propPitchID, propPitch, 2, 0);
-
-    printf("Executing...\n");
-
-    if (xplra_multi_execute(setterID)<0) goto error;
-
-    printf("Done.\n");
-
-    goto cleanup;
-
-error:
-    errorString = xplra_get_last_error_string(connectionID);
-    if (errorString==0) {
-        printf("\nUnknown error occured!\n");
-    } else {
-        printf("\nError: %s\n", errorString);
-    }
-
-    retval = 1;
-
-cleanup:
-    if (connectionID>=0) xplra_disconnect(connectionID);
-    return retval;
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: test/multisettest.cc
===================================================================
--- test/multisettest.cc	(revision 26)
+++ test/multisettest.cc	(revision 26)
@@ -0,0 +1,121 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of XPLRA, a remote-access plugin for X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include <hu/varadiistvan/xplra/XPlane.h>
+#include <hu/varadiistvan/xplra/MultiSetter.h>
+
+#include <hu/varadiistvan/scpl/Thread.h>
+
+#include <cstdio>
+#include <cstring>
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::xplra::XPlane;
+using hu::varadiistvan::xplra::MultiSetter;
+using hu::varadiistvan::xplra::Exception;
+
+using hu::varadiistvan::scpl::Thread;
+
+//------------------------------------------------------------------------------
+
+int main(int argc, char* argv[])
+{
+    bool dontregister = false;
+    for(int i = 1; i<argc; ++i) {
+        if (strcmp(argv[i], "dontregister")==0) {
+            dontregister = true;
+        }
+    }
+
+    try {
+        XPlane xplane;
+
+        printf("Connecting to X-Plane...\n");
+        xplane.connect();
+        printf("Connected to X-Plane.\n\n");
+
+        MultiSetter& setter = xplane.createMultiSetter();
+
+        try {
+            const size_t simSpeedID = setter.addInt("sim/time/sim_speed");
+            const size_t zuluSecID = setter.addFloat("sim/time/zulu_time_sec");
+            const size_t localXID = setter.addDouble("sim/flightmodel/position/local_x");
+            const size_t tailNumID = setter.addByteArray("sim/aircraft/view/acf_tailnum", 40);
+            const size_t generatorOnID = setter.addIntArray("sim/cockpit/electrical/generator_on", 8);
+            const size_t propPitchID = setter.addFloatArray("sim/cockpit2/engine/actuators/prop_pitch_deg", 2);
+
+            if (dontregister) {
+                setter.finalize();
+            } else {
+                printf("Registering getter...\n");
+                setter.registerInXPlane();
+                printf("Registered getter.\n\n");
+            }
+
+            printf("Setting values...\n");
+
+            setter.setInt(simSpeedID, 0);
+            setter.setFloat(zuluSecID, 7265.0);
+            setter.setDouble(localXID, 12.0);
+            setter.setString(tailNumID, "Kukutyin");
+            int32_t generatorOn[8] = { 1, 0, 1, 0, 1, 0, 1, 0 };
+            setter.setIntArray(generatorOnID, generatorOn, 8);
+            float propPitch[2] = { 32.4, 78.2 };
+            setter.setFloatArray(propPitchID, propPitch, 2);
+
+            printf("Executing...\n");
+
+            setter.execute();
+
+            printf("Done.\n");
+
+            //xplane.destroyMultiBuffer(setter);
+
+            return 0;
+        } catch(Exception& exception) {
+            printf("\n>>>>>>>>>>>>>>>>> Exception caugth: %s\n", exception.what());
+
+            return 1;
+        }
+    } catch(Exception& exception) {
+        printf("\n>>>>>>>>>>>>>>>>> Exception caugth: %s\n", exception.what());
+
+        return 1;
+    }
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: test/multisettest.cc
===================================================================
--- test/multisettest.cc	(revision 26)
+++ 	(revision )
@@ -1,121 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of XPLRA, a remote-access plugin for X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include <hu/varadiistvan/xplra/XPlane.h>
-#include <hu/varadiistvan/xplra/MultiSetter.h>
-
-#include <hu/varadiistvan/scpl/Thread.h>
-
-#include <cstdio>
-#include <cstring>
-
-//------------------------------------------------------------------------------
-
-using hu::varadiistvan::xplra::XPlane;
-using hu::varadiistvan::xplra::MultiSetter;
-using hu::varadiistvan::xplra::Exception;
-
-using hu::varadiistvan::scpl::Thread;
-
-//------------------------------------------------------------------------------
-
-int main(int argc, char* argv[])
-{
-    bool dontregister = false;
-    for(int i = 1; i<argc; ++i) {
-        if (strcmp(argv[i], "dontregister")==0) {
-            dontregister = true;
-        }
-    }
-
-    try {
-        XPlane xplane;
-
-        printf("Connecting to X-Plane...\n");
-        xplane.connect();
-        printf("Connected to X-Plane.\n\n");
-
-        MultiSetter& setter = xplane.createMultiSetter();
-
-        try {
-            const size_t simSpeedID = setter.addInt("sim/time/sim_speed");
-            const size_t zuluSecID = setter.addFloat("sim/time/zulu_time_sec");
-            const size_t localXID = setter.addDouble("sim/flightmodel/position/local_x");
-            const size_t tailNumID = setter.addByteArray("sim/aircraft/view/acf_tailnum", 40);
-            const size_t generatorOnID = setter.addIntArray("sim/cockpit/electrical/generator_on", 8);
-            const size_t propPitchID = setter.addFloatArray("sim/cockpit2/engine/actuators/prop_pitch_deg", 2);
-
-            if (dontregister) {
-                setter.finalize();
-            } else {
-                printf("Registering getter...\n");
-                setter.registerInXPlane();
-                printf("Registered getter.\n\n");
-            }
-
-            printf("Setting values...\n");
-
-            setter.setInt(simSpeedID, 0);
-            setter.setFloat(zuluSecID, 7265.0);
-            setter.setDouble(localXID, 12.0);
-            setter.setString(tailNumID, "Kukutyin");
-            int32_t generatorOn[8] = { 1, 0, 1, 0, 1, 0, 1, 0 };
-            setter.setIntArray(generatorOnID, generatorOn, 8);
-            float propPitch[2] = { 32.4, 78.2 };
-            setter.setFloatArray(propPitchID, propPitch, 2);
-
-            printf("Executing...\n");
-
-            setter.execute();
-
-            printf("Done.\n");
-
-            //xplane.destroyMultiBuffer(setter);
-
-            return 0;
-        } catch(Exception& exception) {
-            printf("\n>>>>>>>>>>>>>>>>> Exception caugth: %s\n", exception.what());
-
-            return 1;
-        }
-    } catch(Exception& exception) {
-        printf("\n>>>>>>>>>>>>>>>>> Exception caugth: %s\n", exception.what());
-
-        return 1;
-    }
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: test/multisettest.py
===================================================================
--- test/multisettest.py	(revision 35)
+++ test/multisettest.py	(revision 35)
@@ -0,0 +1,55 @@
+# Multi-dataref query test program for the Python client library
+
+#------------------------------------------------------------------------------
+
+if __name__ == "__main__":
+    import sys
+    import time
+    from xplra import XPlane, ProtocolException
+
+    xplane = XPlane()
+
+    dontregister = "dontregister" in sys.argv
+
+    try:
+        print "Connecting to X-Plane..."
+        xplane.connect()
+        print "Connected to X-Plane."
+        print
+
+        setter = xplane.createMultiSetter()
+
+        simSpeedID = setter.addInt("sim/time/sim_speed")
+        zuluSecID = setter.addFloat("sim/time/zulu_time_sec")
+        localXID = setter.addDouble("sim/flightmodel/position/local_x")
+        tailNumID = setter.addByteArray("sim/aircraft/view/acf_tailnum", 40)
+        generatorOnID = setter.addIntArray("sim/cockpit/electrical/generator_on", 8)
+        propPitchID = setter.addFloatArray("sim/cockpit2/engine/actuators/prop_pitch_deg", 2)
+
+        if dontregister:
+            setter.finalize()
+        else:
+            print "Registering setter..."
+            setter.register();
+            print "Registered setter"
+            print
+
+        print "Setting values..."
+
+        setter[simSpeedID] = 0
+        setter[zuluSecID] = 7265.0
+        setter[localXID] = 12.0
+        setter[tailNumID] = "Kukutyin"
+        setter[generatorOnID] =[ 1, 0, 1, 0, 1, 0, 1 , 0 ]
+        setter[propPitchID] = [ 32.4, 78.2 ]
+
+        print "Executing..."
+
+        setter.execute()
+
+        print "Done."
+
+    except Exception as e:
+        print ">>>>>>>>>>>>>>>>>>>>>> Exception caught:", str(e)
+    finally:
+        xplane.disconnect()
Index: test/multisettest.py
===================================================================
--- test/multisettest.py	(revision 35)
+++ 	(revision )
@@ -1,55 +1,0 @@
-# Multi-dataref query test program for the Python client library
-
-#------------------------------------------------------------------------------
-
-if __name__ == "__main__":
-    import sys
-    import time
-    from xplra import XPlane, ProtocolException
-
-    xplane = XPlane()
-
-    dontregister = "dontregister" in sys.argv
-
-    try:
-        print "Connecting to X-Plane..."
-        xplane.connect()
-        print "Connected to X-Plane."
-        print
-
-        setter = xplane.createMultiSetter()
-
-        simSpeedID = setter.addInt("sim/time/sim_speed")
-        zuluSecID = setter.addFloat("sim/time/zulu_time_sec")
-        localXID = setter.addDouble("sim/flightmodel/position/local_x")
-        tailNumID = setter.addByteArray("sim/aircraft/view/acf_tailnum", 40)
-        generatorOnID = setter.addIntArray("sim/cockpit/electrical/generator_on", 8)
-        propPitchID = setter.addFloatArray("sim/cockpit2/engine/actuators/prop_pitch_deg", 2)
-
-        if dontregister:
-            setter.finalize()
-        else:
-            print "Registering setter..."
-            setter.register();
-            print "Registered setter"
-            print
-
-        print "Setting values..."
-
-        setter[simSpeedID] = 0
-        setter[zuluSecID] = 7265.0
-        setter[localXID] = 12.0
-        setter[tailNumID] = "Kukutyin"
-        setter[generatorOnID] =[ 1, 0, 1, 0, 1, 0, 1 , 0 ]
-        setter[propPitchID] = [ 32.4, 78.2 ]
-
-        print "Executing..."
-
-        setter.execute()
-
-        print "Done."
-
-    except Exception as e:
-        print ">>>>>>>>>>>>>>>>>>>>>> Exception caught:", str(e)
-    finally:
-        xplane.disconnect()
Index: test/runpy.sh
===================================================================
--- test/runpy.sh	(revision 31)
+++ test/runpy.sh	(revision 31)
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+set -e -u
+
+scriptdir=`dirname $0`
+
+pythondir="${scriptdir}/../src/client/python"
+pythondir=`cd "${pythondir}" && pwd`
+
+PYTHONPATH="${pythondir}:${PYTHONPATH:-}"
+export PYTHONPATH
+
+exec python "$@"
Index: test/runpy.sh
===================================================================
--- test/runpy.sh	(revision 31)
+++ 	(revision )
@@ -1,13 +1,0 @@
-#!/bin/sh
-
-set -e -u
-
-scriptdir=`dirname $0`
-
-pythondir="${scriptdir}/../src/client/python"
-pythondir=`cd "${pythondir}" && pwd`
-
-PYTHONPATH="${pythondir}:${PYTHONPATH:-}"
-export PYTHONPATH
-
-exec python "$@"
