From 2901c85ea7e4eea3d34fd5ad6f1bad028d0181b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Sun, 4 Sep 2011 09:45:44 +0000 Subject: [PATCH] [GB.NET] * NEW: Remove the Net.MaxPathLength constant. git-svn-id: svn://localhost/gambas/trunk@4082 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- gb.net/src/CNet.c | 91 ++++++++++++++++++++++++----------------------- 1 file changed, 46 insertions(+), 45 deletions(-) diff --git a/gb.net/src/CNet.c b/gb.net/src/CNet.c index bca114fd5..4cdeea702 100644 --- a/gb.net/src/CNet.c +++ b/gb.net/src/CNet.c @@ -1,22 +1,22 @@ /*************************************************************************** - CNet.c + CNet.c - (c) 2003-2004 Daniel Campos Fernández + (c) 2003-2004 Daniel Campos Fernández - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ***************************************************************************/ @@ -92,7 +92,7 @@ void ToIPv4(char *src,char *dst,int leadzero) if (!leadzero) sprintf(dst,"%d.%d.%d.%d",nc[0],nc[1],nc[2],nc[3]); - else + else sprintf(dst,"%03d.%03d.%03d.%03d",nc[0],nc[1],nc[2],nc[3]); } @@ -115,42 +115,43 @@ BEGIN_METHOD(CNET_Format,GB_STRING IpString;GB_INTEGER Format;GB_BOOLEAN LeadZer END_METHOD /*************************************************************** - Here we declare the public interface of NetCode class - ***************************************************************/ +Here we declare the public interface of NetCode class +***************************************************************/ GB_DESC CNetDesc[] = { - GB_DECLARE("Net", 0), GB_VIRTUAL_CLASS(), + GB_DECLARE("Net", 0), GB_VIRTUAL_CLASS(), - /* IP Formatting */ - GB_CONSTANT("IPv4","i",0), - /* normal operation */ - GB_CONSTANT("Inactive", "i", NET_INACTIVE), - GB_CONSTANT("Active", "i", NET_ACTIVE), - GB_CONSTANT("Pending", "i", NET_PENDING), - GB_CONSTANT("Accepting", "i", NET_ACCEPTING), - GB_CONSTANT("ReceivingData", "i", NET_RECEIVING_DATA), - GB_CONSTANT("Searching", "i", NET_SEARCHING), - GB_CONSTANT("Connecting", "i", NET_CONNECTING), - GB_CONSTANT("Connected", "i", NET_CONNECTED), - /* net error codes */ - GB_CONSTANT("CannotCreateSocket", "i", NET_CANNOT_CREATE_SOCKET), - GB_CONSTANT("ConnectionRefused", "i", NET_CONNECTION_REFUSED), - GB_CONSTANT("CannotRead", "i", NET_CANNOT_READ), - GB_CONSTANT("CannotWrite", "i", NET_CANNOT_WRITE), - GB_CONSTANT("HostNotFound", "i", NET_HOST_NOT_FOUND), - GB_CONSTANT("CannotBindSocket", "i", NET_CANNOT_BIND_SOCKET), - GB_CONSTANT("CannotListen", "i", NET_CANNOT_LISTEN), - GB_CONSTANT("CannotBindInterface", "i", NET_CANNOT_BIND_INTERFACE), - /* SeverSocket, type */ - GB_CONSTANT("Internet", "i", NET_TYPE_INTERNET), - GB_CONSTANT("Local", "i", NET_TYPE_LOCAL), - GB_CONSTANT("Unix", "i", NET_TYPE_LOCAL), + /* IP Formatting */ + GB_CONSTANT("IPv4","i",0), + /* normal operation */ + GB_CONSTANT("Inactive", "i", NET_INACTIVE), + GB_CONSTANT("Active", "i", NET_ACTIVE), + GB_CONSTANT("Pending", "i", NET_PENDING), + GB_CONSTANT("Accepting", "i", NET_ACCEPTING), + GB_CONSTANT("ReceivingData", "i", NET_RECEIVING_DATA), + GB_CONSTANT("Searching", "i", NET_SEARCHING), + GB_CONSTANT("Connecting", "i", NET_CONNECTING), + GB_CONSTANT("Connected", "i", NET_CONNECTED), + /* net error codes */ + GB_CONSTANT("CannotCreateSocket", "i", NET_CANNOT_CREATE_SOCKET), + GB_CONSTANT("ConnectionRefused", "i", NET_CONNECTION_REFUSED), + GB_CONSTANT("CannotRead", "i", NET_CANNOT_READ), + GB_CONSTANT("CannotWrite", "i", NET_CANNOT_WRITE), + GB_CONSTANT("HostNotFound", "i", NET_HOST_NOT_FOUND), + GB_CONSTANT("CannotBindSocket", "i", NET_CANNOT_BIND_SOCKET), + GB_CONSTANT("CannotListen", "i", NET_CANNOT_LISTEN), + GB_CONSTANT("CannotBindInterface", "i", NET_CANNOT_BIND_INTERFACE), + /* SeverSocket, type */ + GB_CONSTANT("Internet", "i", NET_TYPE_INTERNET), + GB_CONSTANT("Local", "i", NET_TYPE_LOCAL), + GB_CONSTANT("Unix", "i", NET_TYPE_LOCAL), + // Max path length for local sockets - GB_CONSTANT("MaxPathLength", "i", NET_UNIX_PATH_MAX), + //GB_CONSTANT("MaxPathLength", "i", NET_UNIX_PATH_MAX), - GB_STATIC_METHOD("Format", "s", CNET_Format, "(IpString)s[(Format)i(LeadZero)b]"), - - GB_END_DECLARE + GB_STATIC_METHOD("Format", "s", CNET_Format, "(IpString)s[(Format)i(LeadZero)b]"), + + GB_END_DECLARE };