mail[Wesnoth-commits] r43454 - in /trunk: doc/ana/ src/ana/ src/ana/test/


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by billybiset on June 15, 2010 - 21:11:
Author: billynux
Date: Tue Jun 15 21:11:38 2010
New Revision: 43454

URL: http://svn.gna.org/viewcvs/wesnoth?rev=43454&view=rev
Log:
Moved ana's Doxyfile to doc/ana and added a test subdir.

Added:
    trunk/doc/ana/Doxyfile
      - copied, changed from r43453, trunk/src/ana/Doxyfile
    trunk/src/ana/test/
    trunk/src/ana/test/CMakeLists.txt   (with props)
    trunk/src/ana/test/sdl_with_ana.cpp   (with props)
Removed:
    trunk/src/ana/Doxyfile
Modified:
    trunk/src/ana/CMakeLists.txt

Copied: trunk/doc/ana/Doxyfile (from r43453, trunk/src/ana/Doxyfile)
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/doc/ana/Doxyfile?p2=trunk/doc/ana/Doxyfile&p1=trunk/src/ana/Doxyfile&r1=43453&r2=43454&rev=43454&view=diff
==============================================================================
--- trunk/src/ana/Doxyfile (original)
+++ trunk/doc/ana/Doxyfile Tue Jun 15 21:11:38 2010
@@ -6,7 +6,7 @@
 
 OUTPUT_DIRECTORY       = doc/code
 
-CREATE_SUBDIRS         = NO
+CREATE_SUBDIRS         = YES
 
 OUTPUT_LANGUAGE        = English
 
@@ -22,7 +22,7 @@
 
 FULL_PATH_NAMES        = YES
 
-STRIP_FROM_PATH        = 
+STRIP_FROM_PATH        = src/ana
 
 STRIP_FROM_INC_PATH    = 
 
@@ -175,7 +175,7 @@
 
 WARN_LOGFILE           = 
 
-INPUT                  = 
+INPUT                  = ../../src/ana
 
 
 INPUT_ENCODING         = UTF-8

Modified: trunk/src/ana/CMakeLists.txt
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/ana/CMakeLists.txt?rev=43454&r1=43453&r2=43454&view=diff
==============================================================================
--- trunk/src/ana/CMakeLists.txt (original)
+++ trunk/src/ana/CMakeLists.txt Tue Jun 15 21:11:38 2010
@@ -12,3 +12,10 @@
     message ( STATUS "Compiling sample applications as well." )
     add_subdirectory( apps )
 endif ( apps )
+
+option( tests "Compile test applications as well" OFF )
+
+if ( tests )
+    message ( STATUS "Compiling test applications as well." )
+    add_subdirectory( test )
+endif ( tests )

Removed: trunk/src/ana/Doxyfile
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/ana/Doxyfile?rev=43453&view=auto
==============================================================================
--- trunk/src/ana/Doxyfile (original)
+++ trunk/src/ana/Doxyfile (removed)
@@ -1,580 +1,0 @@
-DOXYFILE_ENCODING      = UTF-8
-
-PROJECT_NAME           = ana
-
-PROJECT_NUMBER         =
-
-OUTPUT_DIRECTORY       = doc/code
-
-CREATE_SUBDIRS         = NO
-
-OUTPUT_LANGUAGE        = English
-
-BRIEF_MEMBER_DESC      = YES
-
-REPEAT_BRIEF           = YES
-
-ABBREVIATE_BRIEF       = 
-
-ALWAYS_DETAILED_SEC    = NO
-
-INLINE_INHERITED_MEMB  = NO
-
-FULL_PATH_NAMES        = YES
-
-STRIP_FROM_PATH        = 
-
-STRIP_FROM_INC_PATH    = 
-
-SHORT_NAMES            = NO
-
-JAVADOC_AUTOBRIEF      = YES 
-
-QT_AUTOBRIEF           = NO
-
-MULTILINE_CPP_IS_BRIEF = NO
-
-INHERIT_DOCS           = YES
-
-SEPARATE_MEMBER_PAGES  = NO
-
-TAB_SIZE               = 4
-
-ALIASES                = 
-
-OPTIMIZE_OUTPUT_FOR_C  = NO
-
-OPTIMIZE_OUTPUT_JAVA   = NO
-
-OPTIMIZE_FOR_FORTRAN   = NO
-
-OPTIMIZE_OUTPUT_VHDL   = NO
-
-EXTENSION_MAPPING      = C++
-
-BUILTIN_STL_SUPPORT    = YES
-
-CPP_CLI_SUPPORT        = NO
-
-SIP_SUPPORT            = NO
-
-IDL_PROPERTY_SUPPORT   = YES
-
-DISTRIBUTE_GROUP_DOC   = NO
-
-SUBGROUPING            = YES
-
-TYPEDEF_HIDES_STRUCT   = NO
-
-SYMBOL_CACHE_SIZE      = 0
-
-EXTRACT_ALL            = NO
-
-EXTRACT_PRIVATE        = NO
-
-EXTRACT_STATIC         = NO
-
-EXTRACT_LOCAL_CLASSES  = YES
-
-EXTRACT_LOCAL_METHODS  = NO
-
-EXTRACT_ANON_NSPACES   = NO
-
-HIDE_UNDOC_MEMBERS     = NO
-
-HIDE_UNDOC_CLASSES     = NO
-
-
-HIDE_FRIEND_COMPOUNDS  = NO
-
-
-HIDE_IN_BODY_DOCS      = NO
-
-
-INTERNAL_DOCS          = NO
-
-
-CASE_SENSE_NAMES       = YES
-
-
-HIDE_SCOPE_NAMES       = NO
-
-
-SHOW_INCLUDE_FILES     = YES
-
-
-INLINE_INFO            = YES
-
-
-SORT_MEMBER_DOCS       = YES
-
-
-SORT_BRIEF_DOCS        = NO
-
-
-SORT_GROUP_NAMES       = NO
-
-
-SORT_BY_SCOPE_NAME     = NO
-
-
-GENERATE_TODOLIST      = YES
-
-
-GENERATE_TESTLIST      = YES
-
-
-GENERATE_BUGLIST       = YES
-
-
-GENERATE_DEPRECATEDLIST= YES
-
-
-ENABLED_SECTIONS       = 
-
-
-MAX_INITIALIZER_LINES  = 30
-
-
-SHOW_USED_FILES        = YES
-
-
-SHOW_DIRECTORIES       = NO
-
-
-SHOW_FILES             = YES
-
-
-SHOW_NAMESPACES        = YES
-
-
-FILE_VERSION_FILTER    = 
-
-
-LAYOUT_FILE            = 
-
-
-
-QUIET                  = NO
-
-
-WARNINGS               = YES
-
-
-WARN_IF_UNDOCUMENTED   = YES
-
-
-WARN_IF_DOC_ERROR      = YES
-
-
-WARN_NO_PARAMDOC       = NO
-
-
-WARN_FORMAT            = "$file:$line: $text"
-
-
-WARN_LOGFILE           = 
-
-INPUT                  = 
-
-
-INPUT_ENCODING         = UTF-8
-
-
-FILE_PATTERNS          =  *.cpp *.hpp
-
-
-RECURSIVE              = YES
-
-
-EXCLUDE                = apps
-
-
-EXCLUDE_SYMLINKS       = NO
-
-
-EXCLUDE_PATTERNS       = 
-
-
-EXCLUDE_SYMBOLS        = 
-
-
-EXAMPLE_PATH           = 
-
-
-EXAMPLE_PATTERNS       = 
-
-
-EXAMPLE_RECURSIVE      = NO
-
-
-IMAGE_PATH             = images .
-
-
-INPUT_FILTER           = 
-
-
-FILTER_PATTERNS        = 
-
-
-FILTER_SOURCE_FILES    = NO
-
-
-
-SOURCE_BROWSER         = NO
-
-
-INLINE_SOURCES         = NO
-
-
-STRIP_CODE_COMMENTS    = YES
-
-
-REFERENCED_BY_RELATION = NO
-
-
-REFERENCES_RELATION    = NO
-
-
-REFERENCES_LINK_SOURCE = YES
-
-
-USE_HTAGS              = NO
-
-
-VERBATIM_HEADERS       = YES
-
-
-
-ALPHABETICAL_INDEX     = NO
-
-
-COLS_IN_ALPHA_INDEX    = 5
-
-
-IGNORE_PREFIX          = 
-
-
-
-GENERATE_HTML          = YES
-
-
-HTML_OUTPUT            = html
-
-
-HTML_FILE_EXTENSION    = .html
-
-
-HTML_HEADER            = 
-
-
-HTML_FOOTER            = 
-
-
-HTML_STYLESHEET        = 
-
-
-HTML_ALIGN_MEMBERS     = YES
-
-
-HTML_DYNAMIC_SECTIONS  = NO
-
-
-GENERATE_DOCSET        = NO
-
-
-DOCSET_FEEDNAME        = "Doxygen generated docs"
-
-
-DOCSET_BUNDLE_ID       = org.doxygen.Project
-
-
-GENERATE_HTMLHELP      = NO
-
-
-CHM_FILE               = 
-
-
-HHC_LOCATION           = 
-
-
-GENERATE_CHI           = NO
-
-
-CHM_INDEX_ENCODING     = 
-
-
-BINARY_TOC             = NO
-
-
-TOC_EXPAND             = NO
-
-
-GENERATE_QHP           = NO
-
-
-QCH_FILE               = 
-
-
-QHP_NAMESPACE          = 
-
-
-QHP_VIRTUAL_FOLDER     = doc
-
-
-QHP_CUST_FILTER_NAME   = 
-
-
-QHP_CUST_FILTER_ATTRS  = 
-
-
-QHP_SECT_FILTER_ATTRS  = 
-
-
-QHG_LOCATION           = 
-
-
-DISABLE_INDEX          = NO
-
-
-ENUM_VALUES_PER_LINE   = 4
-
-
-GENERATE_TREEVIEW      = NONE
-
-
-TREEVIEW_WIDTH         = 250
-
-
-FORMULA_FONTSIZE       = 10
-
-
-
-GENERATE_LATEX         = YES
-
-
-LATEX_OUTPUT           = latex
-
-
-LATEX_CMD_NAME         = latex
-
-
-MAKEINDEX_CMD_NAME     = makeindex
-
-
-COMPACT_LATEX          = NO
-
-
-PAPER_TYPE             = a4wide
-
-
-EXTRA_PACKAGES         = 
-
-
-LATEX_HEADER           = 
-
-
-PDF_HYPERLINKS         = YES
-
-
-USE_PDFLATEX           = YES
-
-
-LATEX_BATCHMODE        = NO
-
-
-LATEX_HIDE_INDICES     = NO
-
-
-
-GENERATE_RTF           = NO
-
-
-RTF_OUTPUT             = rtf
-
-
-COMPACT_RTF            = NO
-
-
-RTF_HYPERLINKS         = NO
-
-
-RTF_STYLESHEET_FILE    = 
-
-
-RTF_EXTENSIONS_FILE    = 
-
-
-
-GENERATE_MAN           = NO
-
-
-MAN_OUTPUT             = man
-
-
-MAN_EXTENSION          = .3
-
-
-MAN_LINKS              = NO
-
-
-
-GENERATE_XML           = NO
-
-
-XML_OUTPUT             = xml
-
-
-XML_SCHEMA             = 
-
-
-XML_DTD                = 
-
-
-XML_PROGRAMLISTING     = YES
-
-
-
-GENERATE_AUTOGEN_DEF   = NO
-
-
-
-GENERATE_PERLMOD       = NO
-
-
-PERLMOD_LATEX          = NO
-
-
-PERLMOD_PRETTY         = YES
-
-
-PERLMOD_MAKEVAR_PREFIX = 
-
-
-
-ENABLE_PREPROCESSING   = YES
-
-
-MACRO_EXPANSION        = NO
-
-
-EXPAND_ONLY_PREDEF     = NO
-
-
-SEARCH_INCLUDES        = YES
-
-
-INCLUDE_PATH           = 
-
-
-INCLUDE_FILE_PATTERNS  = 
-
-
-PREDEFINED             = 
-
-
-EXPAND_AS_DEFINED      = 
-
-
-SKIP_FUNCTION_MACROS   = YES
-
-
-
-TAGFILES               = 
-
-
-GENERATE_TAGFILE       = 
-
-
-ALLEXTERNALS           = NO
-
-
-EXTERNAL_GROUPS        = YES
-
-
-PERL_PATH              = /usr/bin/perl
-
-
-
-CLASS_DIAGRAMS         = YES
-
-
-MSCGEN_PATH            = 
-
-
-HIDE_UNDOC_RELATIONS   = YES
-
-
-HAVE_DOT               = YES
-
-
-DOT_FONTNAME           = FreeSans
-
-
-DOT_FONTSIZE           = 10
-
-
-DOT_FONTPATH           = 
-
-
-CLASS_GRAPH            = YES
-
-
-COLLABORATION_GRAPH    = YES
-
-
-GROUP_GRAPHS           = YES
-
-
-UML_LOOK               = YES
-
-
-TEMPLATE_RELATIONS     = YES
-
-
-INCLUDE_GRAPH          = YES
-
-
-INCLUDED_BY_GRAPH      = YES
-
-
-CALL_GRAPH             = NO
-
-
-CALLER_GRAPH           = NO
-
-
-GRAPHICAL_HIERARCHY    = YES
-
-
-DIRECTORY_GRAPH        = YES
-
-
-DOT_IMAGE_FORMAT       = png
-
-
-DOT_PATH               = 
-
-
-DOTFILE_DIRS           = 
-
-
-DOT_GRAPH_MAX_NODES    = 50
-
-
-MAX_DOT_GRAPH_DEPTH    = 0
-
-
-DOT_TRANSPARENT        = NO
-
-
-DOT_MULTI_TARGETS      = NO
-
-
-GENERATE_LEGEND        = YES
-
-
-DOT_CLEANUP            = YES
-
-
-SEARCHENGINE           = NO

Added: trunk/src/ana/test/CMakeLists.txt
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/ana/test/CMakeLists.txt?rev=43454&view=auto
==============================================================================
--- trunk/src/ana/test/CMakeLists.txt (added)
+++ trunk/src/ana/test/CMakeLists.txt Tue Jun 15 21:11:38 2010
@@ -1,0 +1,9 @@
+# $Id$
+
+find_package(SDL_net REQUIRED)
+
+include_directories( ../api )
+
+add_executable( sdl_test sdl_with_ana.cpp )
+
+target_link_libraries( sdl_test ana ${SDLNET_LIBRARY} )

Propchange: trunk/src/ana/test/CMakeLists.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: trunk/src/ana/test/CMakeLists.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: trunk/src/ana/test/sdl_with_ana.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/ana/test/sdl_with_ana.cpp?rev=43454&view=auto
==============================================================================
--- trunk/src/ana/test/sdl_with_ana.cpp (added)
+++ trunk/src/ana/test/sdl_with_ana.cpp Tue Jun 15 21:11:38 2010
@@ -1,0 +1,153 @@
+#include <iostream>
+
+#include <SDL/SDL_net.h>
+
+#include <ana.hpp>
+
+using namespace ana;
+
+const port DEFAULT_PORT = "12345";
+
+int main(int argc, char **argv)
+{
+    TCPsocket sd, csd; /* Socket descriptor, Client socket descriptor */
+    IPaddress ip, *remoteIP;
+    int quit, quit2;
+    char buffer[512];
+
+    if (SDLNet_Init() < 0)
+    {
+        fprintf(stderr, "SDLNet_Init: %s\n", SDLNet_GetError());
+        exit(EXIT_FAILURE);
+    }
+
+    /* Resolving the host using NULL make network interface to listen */
+    if (SDLNet_ResolveHost(&ip, NULL, 2000) < 0)
+    {
+        fprintf(stderr, "SDLNet_ResolveHost: %s\n", SDLNet_GetError());
+        exit(EXIT_FAILURE);
+    }
+
+    /* Open a connection with the IP provided (listen on the host's port) */
+    if (!(sd = SDLNet_TCP_Open(&ip)))
+    {
+        fprintf(stderr, "SDLNet_TCP_Open: %s\n", SDLNet_GetError());
+        exit(EXIT_FAILURE);
+    }
+
+    /* Wait for a connection, send data and term */
+    quit = 0;
+    while (!quit)
+    {
+        /* This check the sd if there is a pending connection.
+        * If there is one, accept that, and open a new socket for 
communicating */
+        if ((csd = SDLNet_TCP_Accept(sd)))
+        {
+            /* Now we can communicate with the client using csd socket
+            * sd will remain opened waiting other connections */
+
+            /* Get the remote address */
+            if ((remoteIP = SDLNet_TCP_GetPeerAddress(csd)))
+                /* Print the address, converting in the host format */
+                printf("Host connected: %x %d\n", 
SDLNet_Read32(&remoteIP->host), SDLNet_Read16(&remoteIP->port));
+            else
+                fprintf(stderr, "SDLNet_TCP_GetPeerAddress: %s\n", 
SDLNet_GetError());
+
+            quit2 = 0;
+            while (!quit2)
+            {
+                if (SDLNet_TCP_Recv(csd, buffer, 512) > 0)
+                {
+                    printf("Client say: %s\n", buffer);
+
+                    if(strcmp(buffer, "exit") == 0) /* Terminate this 
connection */
+                    {
+                        quit2 = 1;
+                        printf("Terminate connection\n");
+                    }
+                    if(strcmp(buffer, "quit") == 0) /* Quit the program */
+                    {
+                        quit2 = 1;
+                        quit = 1;
+                        printf("Quit program\n");
+                    }
+                }
+            }
+
+            /* Close the client socket */
+            SDLNet_TCP_Close(csd);
+        }
+    }
+
+    SDLNet_TCP_Close(sd);
+    SDLNet_Quit();
+
+    return EXIT_SUCCESS;
+}
+
+/*
+class test_server : public listener_handler,
+                    public send_handler,
+                    public connection_handler
+{
+    public:
+        test_server() :
+            server_( ana::server::create() )
+        {
+        }
+
+        void run(port pt)
+        {
+            server_->set_connection_handler( this );
+
+            server_->set_listener_handler( this );
+
+            server_->run(pt);
+
+            std::cout << "Server running, Enter to quit." << std::endl;
+
+            std::string s;
+            std::getline(std::cin, s); //yes, i've seen better code :)
+        }
+
+        ~test_server()
+        {
+            delete server_;
+        }
+    private:
+
+        virtual void handle_connect(ana::error_code error, client_id client)
+        {
+            if (! error)
+                std::cout << "Server: User " << client << " has joined.\n";
+        }
+
+        virtual void handle_disconnect(ana::error_code error, client_id 
client)
+        {
+            std::cout << "Server: User " << client << " disconnected.\n";
+        }
+
+        virtual void handle_send(ana::error_code error, client_id client)
+        {
+            if ( error )
+                std::cerr << "Error sending to client " << client << ". 
Timeout?" << std::endl;
+        }
+
+        virtual void handle_message( ana::error_code error, client_id 
client, ana::detail::read_buffer buffer)
+        {
+            if (! error)
+                std::cout << buffer->string() << std::endl;
+            else
+                handle_disconnect(error, client);
+        }
+
+        server*                          server_;
+};
+
+
+int main()
+{
+    test_server test;
+    test.run(DEFAULT_PORT);
+}
+*/

Propchange: trunk/src/ana/test/sdl_with_ana.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: trunk/src/ana/test/sdl_with_ana.cpp
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"




Related Messages


Powered by MHonArc, Updated Tue Jun 15 21:20:13 2010