]> git.mxchange.org Git - flightgear.git/commitdiff
Replace plib/net.h by SimGear
authorFrederic Bouvier <fredfgfs01@free.fr>
Wed, 5 Jan 2011 16:18:12 +0000 (17:18 +0100)
committerFrederic Bouvier <fredfgfs01@free.fr>
Wed, 5 Jan 2011 16:18:12 +0000 (17:18 +0100)
projects/VC90/GPSsmooth/GPSsmooth.vcproj
projects/VC90/MIDGsmooth/MIDGsmooth.vcproj
projects/VC90/UGsmooth/UGsmooth.vcproj
utils/GPSsmooth/MIDG_main.cxx
utils/GPSsmooth/UGear_main.cxx
utils/GPSsmooth/UGear_telnet.cxx
utils/GPSsmooth/UGear_telnet.hxx
utils/GPSsmooth/gps_main.cxx

index b1b37fc758cc3a248809a60b32ed92239b8c3faf..d804c8d6a4b37639a36ea5377596676379cc8f0c 100644 (file)
@@ -46,7 +46,7 @@
                                Name="VCCLCompilerTool"
                                Optimization="0"
                                AdditionalIncludeDirectories="..\..\..\src;..\..\..\..\SimGear;..\..\..\..\install\msvc90\OpenSceneGraph\include;..\..\..\..\3rdParty\include"
-                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
+                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;HAVE_WINDOWS_H"
                                MinimalRebuild="true"
                                BasicRuntimeChecks="3"
                                RuntimeLibrary="3"
                                Name="VCCLCompilerTool"
                                Optimization="0"
                                AdditionalIncludeDirectories="..\..\..\src;..\..\..\..\SimGear;..\..\..\..\install\msvc90-64\OpenSceneGraph\include;..\..\..\..\3rdParty.x64\include"
-                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
+                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;HAVE_WINDOWS_H"
                                MinimalRebuild="true"
                                BasicRuntimeChecks="3"
                                RuntimeLibrary="3"
                        <Tool
                                Name="VCCLCompilerTool"
                                AdditionalIncludeDirectories="..\..\..\src;..\..\..\..\SimGear;..\..\..\..\install\msvc90\OpenSceneGraph\include;..\..\..\..\3rdParty\include"
-                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;HAVE_WINDOWS_H"
                                RuntimeLibrary="2"
                                UsePrecompiledHeader="0"
                                WarningLevel="3"
                        <Tool
                                Name="VCCLCompilerTool"
                                AdditionalIncludeDirectories="..\..\..\src;..\..\..\..\SimGear;..\..\..\..\install\msvc90-64\OpenSceneGraph\include;..\..\..\..\3rdParty\include"
-                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;HAVE_WINDOWS_H"
                                RuntimeLibrary="2"
                                UsePrecompiledHeader="0"
                                WarningLevel="3"
index 9e3fbd31048095f8ad4c6dff0e253b67c29f1102..bb7ac9700c34916156e77f946dc0fa3ffd7c214e 100644 (file)
@@ -45,7 +45,7 @@
                                Name="VCCLCompilerTool"
                                Optimization="0"
                                AdditionalIncludeDirectories="..\..\..\src;..\..\..\..\SimGear;..\..\..\..\install\msvc90\OpenSceneGraph\include;..\..\..\..\3rdParty\include"
-                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
+                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;HAVE_WINDOWS_H"
                                MinimalRebuild="true"
                                BasicRuntimeChecks="3"
                                RuntimeLibrary="3"
                                Name="VCCLCompilerTool"
                                Optimization="0"
                                AdditionalIncludeDirectories="..\..\..\src;..\..\..\..\SimGear;..\..\..\..\install\msvc90-64\OpenSceneGraph\include;..\..\..\..\3rdParty.x64\include"
-                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
+                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;HAVE_WINDOWS_H"
                                MinimalRebuild="true"
                                BasicRuntimeChecks="3"
                                RuntimeLibrary="3"
                        <Tool
                                Name="VCCLCompilerTool"
                                AdditionalIncludeDirectories="..\..\..\src;..\..\..\..\SimGear;..\..\..\..\install\msvc90\OpenSceneGraph\include;..\..\..\..\3rdParty\include"
-                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;HAVE_WINDOWS_H"
                                RuntimeLibrary="2"
                                RuntimeTypeInfo="true"
                                UsePrecompiledHeader="0"
                        <Tool
                                Name="VCCLCompilerTool"
                                AdditionalIncludeDirectories="..\..\..\src;..\..\..\..\SimGear;..\..\..\..\install\msvc90-64\OpenSceneGraph\include;..\..\..\..\3rdParty.x64\include"
-                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;HAVE_WINDOWS_H"
                                RuntimeLibrary="2"
                                RuntimeTypeInfo="true"
                                UsePrecompiledHeader="0"
index e9752829bdbdb5bc25a39dd90d3592d9ade43592..b334538ac4c2c3a1f535d478d4f53b8fda101f45 100644 (file)
@@ -45,7 +45,7 @@
                                Name="VCCLCompilerTool"\r
                                Optimization="0"\r
                                AdditionalIncludeDirectories="..\..\..\src;..\..\..\..\SimGear;..\..\..\..\install\msvc90\OpenSceneGraph\include;..\..\..\..\3rdParty\include;..\..\..\..\boost_1_44_0"\r
-                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;HAVE_WINDOWS_H"\r
                                MinimalRebuild="true"\r
                                BasicRuntimeChecks="3"\r
                                RuntimeLibrary="3"\r
                                Name="VCCLCompilerTool"\r
                                Optimization="0"\r
                                AdditionalIncludeDirectories="..\..\..\src;..\..\..\..\SimGear;..\..\..\..\install\msvc90-64\OpenSceneGraph\include;..\..\..\..\3rdParty.x64\include;..\..\..\..\boost_1_44_0"\r
-                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;HAVE_WINDOWS_H"\r
                                MinimalRebuild="true"\r
                                BasicRuntimeChecks="3"\r
                                RuntimeLibrary="3"\r
                        <Tool\r
                                Name="VCCLCompilerTool"\r
                                AdditionalIncludeDirectories="..\..\..\src;..\..\..\..\SimGear;..\..\..\..\install\msvc90\OpenSceneGraph\include;..\..\..\..\3rdParty\include;..\..\..\..\boost_1_44_0"\r
-                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;HAVE_WINDOWS_H"\r
                                RuntimeLibrary="2"\r
                                RuntimeTypeInfo="true"\r
                                UsePrecompiledHeader="0"\r
                        <Tool\r
                                Name="VCCLCompilerTool"\r
                                AdditionalIncludeDirectories="..\..\..\src;..\..\..\..\SimGear;..\..\..\..\install\msvc90-64\OpenSceneGraph\include;..\..\..\..\3rdParty.x64\include;..\..\..\..\boost_1_44_0"\r
-                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;HAVE_WINDOWS_H"\r
                                RuntimeLibrary="2"\r
                                RuntimeTypeInfo="true"\r
                                UsePrecompiledHeader="0"\r
index 613f1d39d8c77d40e0677b0397a410c0d7d29a0d..7b8141254e7bff5beddb50fbdd6e763a80ee9124 100644 (file)
@@ -2,16 +2,20 @@
 #  include <config.h>
 #endif
 
+#ifdef HAVE_WINDOWS_H
+#  include <windows.h>
+#endif
+
 #include <iostream>
 #include <string>
 
-#include <plib/net.h>
 #include <plib/sg.h>
 
 #include <simgear/constants.h>
 #include <simgear/io/lowlevel.hxx> // endian tests
 #include <simgear/io/sg_file.hxx>
 #include <simgear/io/sg_serial.hxx>
+#include <simgear/io/raw_socket.hxx>
 #include <simgear/math/sg_geodesy.hxx>
 #include <simgear/timing/timestamp.hxx>
 
@@ -27,7 +31,7 @@ using std::string;
 
 
 // Network channels
-static netSocket fdm_sock, ctrls_sock;
+static simgear::Socket fdm_sock, ctrls_sock;
 
 // midg data
 MIDGTrack track;
@@ -394,7 +398,7 @@ int main( int argc, char **argv ) {
 
     // Setup up outgoing network connections
 
-    netInit( &argc,argv ); // We must call this before any other net stuff
+    simgear::Socket::initSockets(); // We must call this before any other net stuff
 
     if ( ! fdm_sock.open( false ) ) {  // open a UDP socket
         cout << "error opening fdm output socket" << endl;
index e814c2e07431767975c150dcdb11e7fff02d8f26..faf5d725ff56063a71a00821083a399742cbfead 100644 (file)
@@ -2,6 +2,10 @@
 #  include <config.h>
 #endif
 
+#ifdef HAVE_WINDOWS_H
+#  include <windows.h>
+#endif
+
 #ifndef _WIN32
 #  include <strings.h>         // for bzero()
 #else
 #include <iostream>
 #include <string>
 
-#include <plib/net.h>
 #include <plib/sg.h>
 
 #include <simgear/constants.h>
 #include <simgear/io/lowlevel.hxx> // endian tests
 #include <simgear/io/sg_file.hxx>
+#include <simgear/io/raw_socket.hxx>
 #include <simgear/serial/serial.hxx>
 #include <simgear/math/sg_geodesy.hxx>
 #include <simgear/timing/timestamp.hxx>
@@ -35,7 +39,7 @@ using std::string;
 
 
 // Network channels
-static netSocket fdm_sock, ctrls_sock, opengc_sock;
+static simgear::Socket fdm_sock, ctrls_sock, opengc_sock;
 
 // ugear data
 UGTrack track;
@@ -658,7 +662,7 @@ int main( int argc, char **argv ) {
 
     // Setup up outgoing network connections
 
-    netInit( &argc,argv ); // We must call this before any other net stuff
+    simgear::Socket::initSockets(); // We must call this before any other net stuff
 
     if ( ! opengc_sock.open( false ) ) {  // open a UDP socket
         cout << "error opening opengc output socket" << endl;
index 602a6a9d86be82b70a3fbef84b1518ba3d8c7684..be5b02e9f303f4b3d22ac68dedee62bd210384bd 100644 (file)
 // $Id$
 
 
+#include <simgear/io/sg_netChat.hxx>
 #include <simgear/structure/commands.hxx>
 #include <simgear/misc/strutils.hxx>
 #include <simgear/math/SGMath.hxx>
 
 #include <sstream>
 
-#include <plib/netChat.h>
-
 #include "UGear_command.hxx"
 #include "UGear_telnet.hxx"
 
@@ -41,9 +40,9 @@ using std::ends;
  * Props connection class.
  * This class represents a connection to props client.
  */
-class PropsChannel : public netChat
+class PropsChannel : public simgear::NetChat
 {
-    netBuffer buffer;
+    simgear::NetBuffer buffer;
 
     /**
      * Current property node name.
@@ -188,9 +187,9 @@ UGTelnet::open()
        return false;
     }
 
-    netChannel::open();
-    netChannel::bind( "", port );
-    netChannel::listen( 5 );
+    simgear::NetChannel::open();
+    simgear::NetChannel::bind( "", port );
+    simgear::NetChannel::listen( 5 );
     printf("Telnet server started on port %d\n", port );
 
     enabled = true;
@@ -214,7 +213,7 @@ UGTelnet::close()
 bool
 UGTelnet::process()
 {
-    netChannel::poll();
+    simgear::NetChannel::poll();
     return true;
 }
 
@@ -224,8 +223,8 @@ UGTelnet::process()
 void
 UGTelnet::handleAccept()
 {
-    netAddress addr;
-    int handle = netChannel::accept( &addr );
+    simgear::IPAddress addr;
+    int handle = simgear::NetChannel::accept( &addr );
     printf("Telent server accepted connection from %s:%d\n",
            addr.getHost(), addr.getPort() );
     PropsChannel* channel = new PropsChannel();
index 34500a5c9498c77a58b5db1a31ae842b6258d062..15e88633e2aeb6ded7d44ccb568e87d0d4ddf7a8 100644 (file)
@@ -33,7 +33,7 @@
 using std::string;
 using std::vector;
 
-#include <plib/netChannel.h>
+#include <simgear/io/sg_netChannel.hxx>
 
 
 /**
@@ -41,7 +41,7 @@ using std::vector;
  * This class provides a telnet-like server for remote access to
  * FlightGear properties.
  */
-class UGTelnet: netChannel
+class UGTelnet: simgear::NetChannel
 {
 
 private:
index f5a10d7ac0b36656710bc0529e89e69e8e0802d4..1b98b04a30cfc2ef7d25b016a77bbe4d61f772a8 100644 (file)
@@ -2,13 +2,17 @@
 #  include <config.h>
 #endif
 
+#ifdef HAVE_WINDOWS_H
+#  include <windows.h>
+#endif
+
 #include <iostream>
 #include <string>
 
-#include <plib/net.h>
 #include <plib/sg.h>
 
 #include <simgear/io/lowlevel.hxx> // endian tests
+#include <simgear/io/raw_socket.hxx>
 #include <simgear/timing/timestamp.hxx>
 
 #include <Network/net_ctrls.hxx>
@@ -23,7 +27,7 @@ using std::string;
 
 
 // Network channels
-static netSocket fdm_sock, ctrls_sock;
+static simgear::Socket fdm_sock, ctrls_sock;
 
 // gps data
 GPSTrack track;
@@ -369,7 +373,7 @@ int main( int argc, char **argv ) {
 
     // Setup up outgoing network connections
 
-    netInit( &argc,argv ); // We must call this before any other net stuff
+    simgear::Socket::initSockets(); // We must call this before any other net stuff
 
     if ( ! fdm_sock.open( false ) ) {  // open a UDP socket
         cout << "error opening fdm output socket" << endl;