[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash libbase/network.cpp libbase/network.h ser...
From: |
Rob Savoye |
Subject: |
[Gnash-commit] gnash libbase/network.cpp libbase/network.h ser... |
Date: |
Tue, 31 Oct 2006 17:59:30 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Rob Savoye <rsavoye> 06/10/31 17:59:30
Modified files:
libbase : network.cpp network.h
server/asobj : NetConnection.cpp NetConnection.h
Log message:
* libbase/network.cpp, network.h: Remove enabled testing code
from
base class.
* server/asobj/NetConnection.cpp, NetConnection.h: Add enabled
testing code to where it really belongs.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/network.cpp?cvsroot=gnash&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/network.h?cvsroot=gnash&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetConnection.cpp?cvsroot=gnash&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetConnection.h?cvsroot=gnash&r1=1.7&r2=1.8
Patches:
Index: libbase/network.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/network.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- libbase/network.cpp 29 Oct 2006 18:34:11 -0000 1.15
+++ libbase/network.cpp 31 Oct 2006 17:59:30 -0000 1.16
@@ -32,7 +32,7 @@
#include <cerrno>
#include <fcntl.h>
#ifdef HAVE_WINSOCK_H
-// # include <winsock2.h>
+# include <winsock2.h>
# include <windows.h>
# include <sys/stat.h>
# include <io.h>
@@ -737,64 +737,5 @@
// toggleDebug(true);
}
-#ifdef ENABLE_TESTING
-// These are the callbacks used to define custom methods for our AS
-// classes. This way we can examine the private dats after calling a
-// method to see if it worked correctly.
-void network_geturl(const fn_call& fn)
-{
-
- network_as_object *ptr = (network_as_object*)fn.this_ptr;
- assert(ptr);
- fn.result->set_tu_string(ptr->obj.getURL().c_str());
-}
-
-void network_getprotocol(const fn_call& fn)
-{
- network_as_object *ptr = (network_as_object*)fn.this_ptr;
- assert(ptr);
- fn.result->set_tu_string(ptr->obj.getProtocol().c_str());
-}
-
-void network_gethost(const fn_call& fn)
-{
- network_as_object *ptr = (network_as_object*)fn.this_ptr;
- assert(ptr);
- fn.result->set_tu_string(ptr->obj.getHost().c_str());
-}
-
-void network_getport(const fn_call& fn)
-{
- network_as_object *ptr = (network_as_object*)fn.this_ptr;
- assert(ptr);
- fn.result->set_tu_string(ptr->obj.getPortStr().c_str());
-}
-
-void network_getpath(const fn_call& fn)
-{
- network_as_object *ptr = (network_as_object*)fn.this_ptr;
- assert(ptr);
- fn.result->set_tu_string(ptr->obj.getPath().c_str());
-}
-
-void network_connected(const fn_call& fn)
-{
- network_as_object *ptr = (network_as_object*)fn.this_ptr;
- assert(ptr);
- fn.result->set_bool(ptr->obj.connected());
-}
-void network_getfilefd(const fn_call& fn)
-{
- network_as_object *ptr = (network_as_object*)fn.this_ptr;
- assert(ptr);
- fn.result->set_int(ptr->obj.getFileFd());
-}
-void network_getlistenfd(const fn_call& fn)
-{
- network_as_object *ptr = (network_as_object*)fn.this_ptr;
- assert(ptr);
- fn.result->set_int(ptr->obj.getListenFd());
-}
-#endif
} // end of gnash namespace
Index: libbase/network.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/network.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- libbase/network.h 29 Oct 2006 18:34:11 -0000 1.10
+++ libbase/network.h 31 Oct 2006 17:59:30 -0000 1.11
@@ -32,7 +32,7 @@
# include <netinet/in.h>
# include <arpa/inet.h>
#else
-// # include <winsock2.h>
+# include <winsock2.h>
# include <windows.h>
# include <fcntl.h>
# include <sys/stat.h>
@@ -130,24 +130,6 @@
int _timeout;
};
-#ifdef ENABLE_TESTING
-class DSOEXPORT network_as_object : public as_object
-{
-public:
- Network obj;
-};
-
-DSOEXPORT void network_geturl(const fn_call& fn);
-DSOEXPORT void network_getprotocol(const fn_call& fn);
-DSOEXPORT void network_gethost(const fn_call& fn);
-DSOEXPORT void network_getport(const fn_call& fn);
-DSOEXPORT void network_getpath(const fn_call& fn);
-DSOEXPORT void network_connected(const fn_call& fn);
-
-DSOEXPORT void network_getfilefd(const fn_call& fn);
-DSOEXPORT void network_getlistenfd(const fn_call& fn);
-#endif
-
} // end of gnash namespace
// __NETWORK_H__
Index: server/asobj/NetConnection.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetConnection.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- server/asobj/NetConnection.cpp 29 Oct 2006 18:34:12 -0000 1.9
+++ server/asobj/NetConnection.cpp 31 Oct 2006 17:59:30 -0000 1.10
@@ -146,11 +146,11 @@
netconnection_obj->set_member("connect", &netconnection_connect);
#ifdef ENABLE_TESTING
- netconnection_obj->set_member("geturl", &network_geturl);
- netconnection_obj->set_member("getprotocol", &network_getprotocol);
- netconnection_obj->set_member("gethost", &network_gethost);
- netconnection_obj->set_member("getport", &network_getport);
- netconnection_obj->set_member("getpath", &network_getpath);
+ netconnection_obj->set_member("geturl", &netconnection_geturl);
+ netconnection_obj->set_member("getprotocol", &netconnection_getprotocol);
+ netconnection_obj->set_member("gethost", &netconnection_gethost);
+ netconnection_obj->set_member("getport", &netconnection_getport);
+ netconnection_obj->set_member("getpath", &netconnection_getpath);
#endif
fn.result->set_as_object(netconnection_obj);
}
@@ -172,5 +172,65 @@
}
}
+#ifdef ENABLE_TESTING
+// These are the callbacks used to define custom methods for our AS
+// classes. This way we can examine the private dats after calling a
+// method to see if it worked correctly.
+void netconnection_geturl(const fn_call& fn)
+{
+
+ netconnection_as_object *ptr = (netconnection_as_object*)fn.this_ptr;
+ assert(ptr);
+ fn.result->set_tu_string(ptr->obj.getURL().c_str());
+}
+
+void netconnection_getprotocol(const fn_call& fn)
+{
+ netconnection_as_object *ptr = (netconnection_as_object*)fn.this_ptr;
+ assert(ptr);
+ fn.result->set_tu_string(ptr->obj.getProtocol().c_str());
+}
+
+void netconnection_gethost(const fn_call& fn)
+{
+ netconnection_as_object *ptr = (netconnection_as_object*)fn.this_ptr;
+ assert(ptr);
+ fn.result->set_tu_string(ptr->obj.getHost().c_str());
+}
+
+void netconnection_getport(const fn_call& fn)
+{
+ netconnection_as_object *ptr = (netconnection_as_object*)fn.this_ptr;
+ assert(ptr);
+ fn.result->set_tu_string(ptr->obj.getPortStr().c_str());
+}
+
+void netconnection_getpath(const fn_call& fn)
+{
+ netconnection_as_object *ptr = (netconnection_as_object*)fn.this_ptr;
+ assert(ptr);
+ fn.result->set_tu_string(ptr->obj.getPath().c_str());
+}
+
+void netconnection_connected(const fn_call& fn)
+{
+ netconnection_as_object *ptr = (netconnection_as_object*)fn.this_ptr;
+ assert(ptr);
+ fn.result->set_bool(ptr->obj.connected());
+}
+void netconnection_getfilefd(const fn_call& fn)
+{
+ netconnection_as_object *ptr = (netconnection_as_object*)fn.this_ptr;
+ assert(ptr);
+ fn.result->set_int(ptr->obj.getFileFd());
+}
+void netconnection_getlistenfd(const fn_call& fn)
+{
+ netconnection_as_object *ptr = (netconnection_as_object*)fn.this_ptr;
+ assert(ptr);
+ fn.result->set_int(ptr->obj.getListenFd());
+}
+#endif
+
} // end of gnash namespace
Index: server/asobj/NetConnection.h
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetConnection.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- server/asobj/NetConnection.h 29 Oct 2006 18:34:12 -0000 1.7
+++ server/asobj/NetConnection.h 31 Oct 2006 17:59:30 -0000 1.8
@@ -50,8 +50,21 @@
NetConnection obj;
};
-void netconnection_new(const fn_call& fn);
-void netconnection_connect(const fn_call& fn);
+DSOEXPORT void netconnection_new(const fn_call& fn);
+DSOEXPORT void netconnection_connect(const fn_call& fn);
+
+#ifdef ENABLE_TESTING
+
+DSOEXPORT void netconnection_geturl(const fn_call& fn);
+DSOEXPORT void netconnection_getprotocol(const fn_call& fn);
+DSOEXPORT void netconnection_gethost(const fn_call& fn);
+DSOEXPORT void netconnection_getport(const fn_call& fn);
+DSOEXPORT void netconnection_getpath(const fn_call& fn);
+DSOEXPORT void netconnection_connected(const fn_call& fn);
+
+DSOEXPORT void netconnection_getfilefd(const fn_call& fn);
+DSOEXPORT void netconnection_getlistenfd(const fn_call& fn);
+#endif
} // end of gnash namespace
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash libbase/network.cpp libbase/network.h ser...,
Rob Savoye <=