[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sptk-commits
Subject:    r695 - in trunk/examples/net: . irc
From:       alexey () mail ! total-knowledge ! com
Date:       2009-05-26 23:18:43
Message-ID: courier.000000004A1C78D3.0000620D () mail ! total-knowledge ! com
[Download RAW message or body]

Author: alexey
Date: 2009-05-26 16:18:43 -0700 (Tue, 26 May 2009)
New Revision: 695

Added:
   trunk/examples/net/irc/
   trunk/examples/net/irc/CChannelView.cpp
   trunk/examples/net/irc/CChannelView.h
   trunk/examples/net/irc/CConnectionThread.cpp
   trunk/examples/net/irc/CConnectionThread.h
   trunk/examples/net/irc/CIrcSocket.h
   trunk/examples/net/irc/CMainWindow.cpp
   trunk/examples/net/irc/CMainWindow.h
   trunk/examples/net/irc/spirc.cpp
Modified:
   trunk/examples/net/CMakeLists.txt
   trunk/examples/net/smtp_connect.cpp
   trunk/examples/net/socket_test.cpp
Log:
Added test IRC client


Modified: trunk/examples/net/CMakeLists.txt
===================================================================
--- trunk/examples/net/CMakeLists.txt	2009-05-26 06:24:28 UTC (rev 694)
+++ trunk/examples/net/CMakeLists.txt	2009-05-26 23:18:43 UTC (rev 695)
@@ -28,5 +28,6 @@
 TARGET_LINK_LIBRARIES (socket_test sputil4)
 
 ADD_EXECUTABLE (irc_demo irc_demo.cpp)
-TARGET_LINK_LIBRARIES (socket_test sputil4)
 
+ADD_EXECUTABLE (spirc irc/spirc.cpp irc/CChannelView.cpp irc/CMainWindow.cpp \
irc/CConnectionThread.cpp) +

Added: trunk/examples/net/irc/CChannelView.cpp
===================================================================
--- trunk/examples/net/irc/CChannelView.cpp	                        (rev 0)
+++ trunk/examples/net/irc/CChannelView.cpp	2009-05-26 23:18:43 UTC (rev 695)
@@ -0,0 +1,52 @@
+/***************************************************************************
+                          SIMPLY POWERFUL TOOLKIT (SPTK)
+                          CChannelView.cpp  -  description
+                             -------------------
+    begin                : Tue May 26, 2009
+    copyright            : (C) 2000-2009 by Alexey Parshin
+    email                : alexeyp@gmail.com
+ ***************************************************************************/
+
+/***************************************************************************
+   This library is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Library General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or (at
+   your option) any later version.
+
+   This library is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
+   General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this library; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+
+   Please report all bugs and problems to "alexeyp@gmail.com"
+ ***************************************************************************/
+
+#include "CChannelView.h"
+
+using namespace std;
+using namespace sptk;
+
+CChannelView::CChannelView(std::string channelName,std::string channelKey)
+: CListView("",10,SP_ALIGN_CLIENT), m_channelName(channelName), \
m_channelKey(channelKey) +{
+    addColumn("Timestamp",VAR_INT,100);
+    addColumn("Sender",VAR_STRING,150);
+    addColumn("Message",VAR_STRING,400);
+}
+
+CChannelView::~CChannelView()
+{
+}
+
+void CChannelView::addMessage(std::string nick,std::string text)
+{
+    CDateTime ts = CDateTime::Now();
+    string tstr = ts.timeString(true);
+    cpchar rowData[] = { tstr.c_str(), nick.c_str(), text.c_str() };
+    CPackedStrings *ps = new CPackedStrings(4, rowData);
+    addRow(0,tstr.c_str(), nick.c_str(), text.c_str());
+}

Added: trunk/examples/net/irc/CChannelView.h
===================================================================
--- trunk/examples/net/irc/CChannelView.h	                        (rev 0)
+++ trunk/examples/net/irc/CChannelView.h	2009-05-26 23:18:43 UTC (rev 695)
@@ -0,0 +1,42 @@
+/***************************************************************************
+                          SIMPLY POWERFUL TOOLKIT (SPTK)
+                          CChannelView.h  -  description
+                             -------------------
+    begin                : Tue May 26, 2009
+    copyright            : (C) 2000-2009 by Alexey Parshin
+    email                : alexeyp@gmail.com
+ ***************************************************************************/
+
+/***************************************************************************
+   This library is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Library General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or (at
+   your option) any later version.
+
+   This library is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
+   General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this library; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+
+   Please report all bugs and problems to "alexeyp@gmail.com"
+ ***************************************************************************/
+
+#ifndef __SPIRCCHANNEL_H__
+#define __SPIRCCHANNEL_H__
+
+#include <sptk4/cgui>
+
+class CChannelView : public sptk::CListView {
+    std::string     m_channelName;
+    std::string     m_channelKey;
+public:
+    CChannelView(std::string channelName,std::string channelKey);
+    virtual ~CChannelView();
+    void addMessage(std::string nick,std::string text);
+};
+
+#endif

Added: trunk/examples/net/irc/CConnectionThread.cpp
===================================================================
--- trunk/examples/net/irc/CConnectionThread.cpp	                        (rev 0)
+++ trunk/examples/net/irc/CConnectionThread.cpp	2009-05-26 23:18:43 UTC (rev 695)
@@ -0,0 +1,101 @@
+/***************************************************************************
+                          SIMPLY POWERFUL TOOLKIT (SPTK)
+                          CConnectionThread.cpp  -  description
+                             -------------------
+    begin                : Tue May 26, 2009
+    copyright            : (C) 2000-2009 by Alexey Parshin
+    email                : alexeyp@gmail.com
+ ***************************************************************************/
+
+/***************************************************************************
+   This library is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Library General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or (at
+   your option) any later version.
+
+   This library is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
+   General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this library; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+
+   Please report all bugs and problems to "alexeyp@gmail.com"
+ ***************************************************************************/
+
+#include "CConnectionThread.h"
+
+using namespace std;
+using namespace sptk;
+
+CConnectionThread::CConnectionThread(std::string serverName, uint16_t port, \
std::string nickName, CBaseLog& sharedLog) : +    CThread(serverName + " thread", \
true), m_log(sharedLog, "CONN ") +{
+    m_socket = new CIrcSocket(serverName,port,nickName);
+
+    // Put anything you need here to define your actual thread
+    m_log << CLP_INFO << name() << " is created" << endl;
+}
+
+CConnectionThread::~CConnectionThread()
+{
+    delete m_socket;
+}
+
+static bool processMessage(CIrcSocket& irc, CIrcMessage& message, string channel, \
string nickName) +{
+    size_t pos = message.text.find(nickName);
+    if (pos == string::npos)
+        return true; /// message isn't for me
+    pos += nickName.length();
+    string lcText = lowerCase(message.text);
+    if (message.text[pos] == 0 || !isalnum(message.text[pos])) {
+        /// message is for me
+        if (lcText.find("go away") != string::npos) {
+            /// Quit command
+            irc.message(channel, "Bye-bye, everybody");
+            irc.quit();
+            return false;
+        }
+    }
+    return true;
+}
+
+// The thread function. Prints a message once a second till terminated
+void CConnectionThread::threadFunction()
+{
+    m_log << CLP_NOTICE << name() << " is started" << endl;
+    char buffer[2048];
+
+    while (!terminated()) {
+        try {
+            if (!m_socket->active())
+                m_socket->open();
+        } catch (const exception& e) {
+            m_log << CLP_ERROR << e.what() << endl;
+            sleep(5);
+            continue;
+        }
+        try {
+            if (!m_socket->readyToRead(1000))
+                continue;
+            int bytes = m_socket->availableBytes();
+            if (bytes) {
+                bytes = m_socket->read(buffer, bytes, "\r");
+                buffer[bytes] = 0;
+                cout << buffer;
+            }
+            //if (m_socket->parseMessage(message, buffer)) {
+                //if (!processMessage(m_socket, message, ircChannelName, \
ircNickName)) +                //    break;
+           // }
+        } catch (const exception& e) {
+            m_log << CLP_ERROR << e.what() << endl;
+            sleep(1);
+        }
+    }
+
+    m_log << CLP_NOTICE << name() << " is terminated" << endl;
+}

Added: trunk/examples/net/irc/CConnectionThread.h
===================================================================
--- trunk/examples/net/irc/CConnectionThread.h	                        (rev 0)
+++ trunk/examples/net/irc/CConnectionThread.h	2009-05-26 23:18:43 UTC (rev 695)
@@ -0,0 +1,48 @@
+/***************************************************************************
+                          SIMPLY POWERFUL TOOLKIT (SPTK)
+                          CConnectionThread.h  -  description
+                             -------------------
+    begin                : Tue May 26, 2009
+    copyright            : (C) 2000-2009 by Alexey Parshin
+    email                : alexeyp@gmail.com
+ ***************************************************************************/
+
+/***************************************************************************
+   This library is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Library General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or (at
+   your option) any later version.
+
+   This library is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
+   General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this library; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+
+   Please report all bugs and problems to "alexeyp@gmail.com"
+ ***************************************************************************/
+
+#ifndef __CCCONNECTIONTHREAD_H__
+#define __CCCONNECTIONTHREAD_H__
+
+#include "CIrcSocket.h"
+
+class CConnectionThread: public sptk::CThread {
+    CIrcSocket*     m_socket;
+    sptk::CProxyLog m_log; /// Thread proxy log
+public:
+
+    /// @brief Constructor
+    CConnectionThread(std::string serverName, uint16_t port, std::string nickName, \
sptk::CBaseLog& sharedLog); +
+    /// @brief Destructor
+    ~CConnectionThread();
+
+    /// @brief The thread function.
+    virtual void threadFunction();
+};
+
+#endif

Added: trunk/examples/net/irc/CIrcSocket.h
===================================================================
--- trunk/examples/net/irc/CIrcSocket.h	                        (rev 0)
+++ trunk/examples/net/irc/CIrcSocket.h	2009-05-26 23:18:43 UTC (rev 695)
@@ -0,0 +1,89 @@
+/***************************************************************************
+                          CIrcSocket.h  -  description
+                             -------------------
+    begin                : Tue May 26 2009
+    copyright            : (C) 2000-2009 by Alexey Parshin
+    email                : alexeyp@gmail.com
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef __CIRCSOCKET_H__
+#define __CIRCSOCKET_H__
+
+#include <sptk4/cutils>
+#include <string>
+#include <map>
+
+struct CIrcMessage {
+    std::string channel;
+    std::string from;
+    std::string text;
+};
+
+class CIrcSocket: public sptk::CTCPSocket, public sptk::CWaiter {
+    std::string      m_nick;
+public:
+    CIrcSocket(std::string host, uint16_t port, std::string nick)
+    : m_nick(nick)
+    {
+        m_host = host;
+        m_port = port;
+    }
+
+    void introduce()
+    {
+        write("NICK " + m_nick + "\r");
+        write("USER " + m_nick + " " + m_host + " home.net spirc\r");
+    }
+
+    void nick(std::string name)
+    {
+        m_nick = name;
+        write("NICK " + name + "\r");
+    }
+
+    void join(std::string channelName,std::string channelKey)
+    {
+        write("JOIN " + channelName + " " + channelKey + "\r");
+    }
+
+    void quit()
+    {
+        write("QUIT\r");
+        close();
+    }
+
+    void message(std::string room, std::string msg)
+    {
+        write("PRIVMSG " + room + " :" + msg + "\r");
+    }
+
+    bool parseMessage(CIrcMessage& message, std::string ircMessage)
+    {
+        size_t messageStart = ircMessage.find(" PRIVMSG ");
+        if (messageStart == std::string::npos)
+            return false;
+        messageStart += strlen(" PRIVMSG ");
+        size_t pos = ircMessage.find("!");
+        if (pos == std::string::npos)
+            return false;
+        message.from = ircMessage.substr(1, pos - 1);
+        pos = ircMessage.find(" :", messageStart);
+        if (pos == std::string::npos)
+            return false;
+        message.channel = ircMessage.substr(messageStart, pos - messageStart);
+        messageStart = pos + 2;
+        message.text = ircMessage.substr(messageStart);
+        return true;
+    }
+};
+
+#endif

Added: trunk/examples/net/irc/CMainWindow.cpp
===================================================================
--- trunk/examples/net/irc/CMainWindow.cpp	                        (rev 0)
+++ trunk/examples/net/irc/CMainWindow.cpp	2009-05-26 23:18:43 UTC (rev 695)
@@ -0,0 +1,116 @@
+/***************************************************************************
+                          SIMPLY POWERFUL TOOLKIT (SPTK)
+                          CMainWindow.cpp  -  description
+                             -------------------
+    begin                : Tue May 26, 2009
+    copyright            : (C) 2000-2009 by Alexey Parshin
+    email                : alexeyp@gmail.com
+ ***************************************************************************/
+
+/***************************************************************************
+   This library is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Library General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or (at
+   your option) any later version.
+
+   This library is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
+   General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this library; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+
+   Please report all bugs and problems to "alexeyp@gmail.com"
+ ***************************************************************************/
+
+#include "CMainWindow.h"
+#include <sptk4/gui/CMenuBar.h>
+using namespace std;
+using namespace sptk;
+
+Fl_Menu_Item menuitems[] = {
+   { "&Irc",                0, 0, 0, FL_SUBMENU },
+   { "&New Connection",     0, 0 },
+   { "E&xit",               FL_CTRL + 'q', CMainWindow::quit },
+   { 0,                     0, 0, 0, 0 },
+
+   { "&Edit",               0, 0, 0, FL_SUBMENU },
+   { "Cu&t",                FL_CTRL + 'x', 0 },
+   { "&Copy",               FL_CTRL + 'c', 0 },
+   { "&Paste",              FL_CTRL + 'v', 0 },
+   { "&Delete",             0, 0 },
+   { 0,                     0, 0, 0, 0 },
+
+   { 0,                     0, 0, 0, 0 }
+};
+
+CMainWindow* mainWindow;
+
+void CMainWindow::quit(Fl_Widget*,void*)
+{
+    mainWindow->hide();
+}
+
+CMainWindow::CMainWindow()
+: CWindow(600,400,"SpIRC v 0.99"), m_log("spirc.log")
+{
+    mainWindow = this;
+
+    m_mainMenu = new CMenuBar;
+    m_mainMenu->copy(menuitems, this);
+    m_tabs = new CTabs("",10,SP_ALIGN_CLIENT);
+    m_tabs->end();
+    m_inputGroup = new CGroup("",10,SP_ALIGN_BOTTOM);
+    new CInput("Nick",10,SP_ALIGN_BOTTOM);
+    m_inputGroup->end();
+
+    newTab("Server Messages");
+    newTab("#gentoo-ru");
+
+    resizable(this);
+    relayout();
+}
+
+void CMainWindow::newTab(const char* channelName)
+{
+    CGroup *group = (CGroup *) m_tabs->newPage(channelName);
+    //group->box(FL_THIN_DOWN_BOX);
+    CChannelView* channelView = new CChannelView(channelName,"");
+    m_channelViewMap[channelName] = channelView;
+    group->end();
+    addMessage(channelName,"SpIRC","Welcome to "+string(channelName));
+}
+
+void CMainWindow::addMessage(std::string channel,std::string nick,std::string text)
+{
+    CChannelViewMap::iterator itor = m_channelViewMap.find(channel);
+    if (itor == m_channelViewMap.end())
+        return;
+    CChannelView* channelView = itor->second;
+    channelView->addMessage(nick,text);
+}
+
+CIrcSocket* CMainWindow::connection(std::string serverName)
+{
+    CIrcSocketMap::iterator itor = m_ircConnections.find(serverName);
+    if (itor == m_ircConnections.end())
+        throw CException("Not connected to " + serverName);
+    return itor->second;
+}
+
+void CMainWindow::connect(std::string server,uint16_t port,std::string nick)
+{
+    try {
+        connection(server);
+        return; /// Already connected
+    } catch (...) {
+        CIrcSocket* socket = new CIrcSocket(server,port,nick);
+        socket->readTimeout(30000);
+        socket->writeTimeout(30000);
+        socket->open();
+        socket->introduce();
+        m_ircConnections[server] = socket;
+    }
+}

Added: trunk/examples/net/irc/CMainWindow.h
===================================================================
--- trunk/examples/net/irc/CMainWindow.h	                        (rev 0)
+++ trunk/examples/net/irc/CMainWindow.h	2009-05-26 23:18:43 UTC (rev 695)
@@ -0,0 +1,62 @@
+/***************************************************************************
+                          SIMPLY POWERFUL TOOLKIT (SPTK)
+                          CMainWindow.h  -  description
+                             -------------------
+    begin                : Tue May 26, 2009
+    copyright            : (C) 2000-2009 by Alexey Parshin
+    email                : alexeyp@gmail.com
+ ***************************************************************************/
+
+/***************************************************************************
+   This library is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Library General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or (at
+   your option) any later version.
+
+   This library is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
+   General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this library; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+
+   Please report all bugs and problems to "alexeyp@gmail.com"
+ ***************************************************************************/
+
+#ifndef __SPIRCWINDOW_H__
+#define __SPIRCWINDOW_H__
+
+#include <sptk4/cutils>
+#include <sptk4/cgui>
+#include "CChannelView.h"
+#include "CIrcSocket.h"
+
+class CMainWindow : public sptk::CWindow {
+    sptk::CMenuBar*     m_mainMenu;
+    sptk::CGroup*       m_inputGroup;
+    sptk::CTabs*        m_tabs;
+
+    sptk::CFileLog      m_log;
+
+    typedef std::map<std::string,CIrcSocket*> CIrcSocketMap;
+    CIrcSocketMap       m_ircConnections;
+
+    typedef std::map<std::string,CChannelView*> CChannelViewMap;
+    CChannelViewMap     m_channelViewMap;
+
+    void addMessage(std::string channel,std::string nick,std::string text);
+
+public:
+    static void quit(Fl_Widget*,void*);
+public:
+    CMainWindow();
+    void newTab(const char* tabName);
+    void connect(std::string serverName,uint16_t port,std::string nick);
+    CIrcSocket* connection(std::string serverName);
+};
+
+extern CMainWindow* mainWindow;
+
+#endif

Added: trunk/examples/net/irc/spirc.cpp
===================================================================
--- trunk/examples/net/irc/spirc.cpp	                        (rev 0)
+++ trunk/examples/net/irc/spirc.cpp	2009-05-26 23:18:43 UTC (rev 695)
@@ -0,0 +1,61 @@
+/***************************************************************************
+                          spirc_main.cpp  -  description
+                             -------------------
+    begin                : Tue May 26 2009
+    copyright            : (C) 2000-2009 by Alexey Parshin
+    email                : alexeyp@gmail.com
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#include "CMainWindow.h"
+#include <sptk4/cutils>
+#include <string>
+#include <map>
+#include <iostream>
+
+using namespace std;
+using namespace sptk;
+
+int main(int, const char**)
+{
+    CMainWindow mainWindow;
+    mainWindow.connect("chat.freenode.net",6667,"alexeyp");
+    mainWindow.show();
+    Fl::run();
+
+    /*
+    CIrcMessage message;
+    try {
+        char buffer[2048];
+        socket.join(ircChannelName, ircChannelKey);
+        socket.message(ircChannelName, "Hello");
+        socket.message(ircChannelName, "I'm here");
+
+        while (true) {
+            if (!socket.readyToRead(1000))
+                continue;
+            int bytes = socket.availableBytes();
+            if (bytes) {
+                bytes = socket.read(buffer, bytes, "\r");
+                buffer[bytes] = 0;
+                cout << buffer;
+            }
+            if (socket.parseMessage(message, buffer)) {
+                if (!processMessage(socket, message, ircChannelName, ircNickName))
+                    break;
+            }
+        }
+    } catch (exception& e) {
+        log << e.what() << endl;
+    }
+    */
+    return 0;
+}

Modified: trunk/examples/net/smtp_connect.cpp
===================================================================
--- trunk/examples/net/smtp_connect.cpp	2009-05-26 06:24:28 UTC (rev 694)
+++ trunk/examples/net/smtp_connect.cpp	2009-05-26 23:18:43 UTC (rev 695)
@@ -1,3 +1,30 @@
+/***************************************************************************
+                          SIMPLY POWERFUL TOOLKIT (SPTK)
+                          smtp_connect.cpp  -  description
+                             -------------------
+    begin                : Wed Apr 20, 2005
+    copyright            : (C) 2000-2009 by Alexey Parshin
+    email                : alexeyp@gmail.com
+ ***************************************************************************/
+
+/***************************************************************************
+   This library is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Library General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or (at
+   your option) any later version.
+
+   This library is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
+   General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this library; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+
+   Please report all bugs and problems to "alexeyp@gmail.com"
+ ***************************************************************************/
+
 #include <sptk4/cutils>
 #include <sptk4/net/CSmtpConnect.h>
 #include <iostream>

Modified: trunk/examples/net/socket_test.cpp
===================================================================
--- trunk/examples/net/socket_test.cpp	2009-05-26 06:24:28 UTC (rev 694)
+++ trunk/examples/net/socket_test.cpp	2009-05-26 23:18:43 UTC (rev 695)
@@ -1,3 +1,30 @@
+/***************************************************************************
+                          SIMPLY POWERFUL TOOLKIT (SPTK)
+                          socket_test.cpp  -  description
+                             -------------------
+    begin                : Wed Apr 20, 2005
+    copyright            : (C) 2000-2009 by Alexey Parshin
+    email                : alexeyp@gmail.com
+ ***************************************************************************/
+
+/***************************************************************************
+   This library is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Library General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or (at
+   your option) any later version.
+
+   This library is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
+   General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this library; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+
+   Please report all bugs and problems to "alexeyp@gmail.com"
+ ***************************************************************************/
+
 #include <sptk4/cutils>
 #include <iostream>
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic