diff --git a/CMakeLists.txt b/CMakeLists.txt index bbfdb65..fa0f2c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,11 +7,30 @@ set(GCC_COVERAGE_COMPILE_FLAGS "-Werror") set(SOURCE_FILES modules/peer.h modules/peer.c utility.c utility.h modules/webio.h modules/webio.c modules/config.h modules/config.c lib/map.h lib/map.c lib/tcp-listener.c lib/tcp-listener.h) option(BUILD_DOC "Build Documentation" ON) +find_package(Doxygen) +if(DOXYGEN_FOUND) + set(BUILD_DOC_DIR ${CMAKE_SOURCE_DIR}/build/docs) + if(NOT EXISTS ${BUILD_DOC_DIR}) + file(MAKE_DIRECTORY ${BUILD_DOC_DIR}) + endif() + set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile) + set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) + configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY) -add_executable(p2p main.c modules/peer.h modules/peer.c utility.c utility.h modules/webio.h modules/webio.c modules/config.h modules/config.c lib/map.h lib/map.c lib/tcp-listener.c lib/tcp-listener.h lib/net.h) -add_executable(p2p-2 main.c modules/peer.h modules/peer.c utility.c utility.h modules/webio.h modules/webio.c modules/config.h modules/config.c lib/map.h lib/map.c lib/tcp-listener.c lib/tcp-listener.h lib/net.h) -add_executable(p2p-3 main.c modules/peer.h modules/peer.c utility.c utility.h modules/webio.h modules/webio.c modules/config.h modules/config.c lib/map.h lib/map.c lib/tcp-listener.c lib/tcp-listener.h lib/net.h) + message("Doxygen build started") + add_custom_target(Doxygen ALL + COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Generating API documentation with Doxygen" + VERBATIM) +else(DOXYGEN_FOUND) + message("Doxygen needs to be installed to generate the documentation.") +endif(DOXYGEN_FOUND) + +add_executable(p2p main.c modules/peer.h modules/peer.c utility.c utility.h modules/webio.h modules/webio.c modules/config.h modules/config.c lib/map.h lib/map.c lib/tcp-listener.c lib/tcp-listener.h lib/net.h modules/server.c modules/server.h) +add_executable(p2p-2 main.c modules/peer.h modules/peer.c utility.c utility.h modules/webio.h modules/webio.c modules/config.h modules/config.c lib/map.h lib/map.c lib/tcp-listener.c lib/tcp-listener.h lib/net.h modules/server.c modules/server.h) +add_executable(p2p-3 main.c modules/peer.h modules/peer.c utility.c utility.h modules/webio.h modules/webio.c modules/config.h modules/config.c lib/map.h lib/map.c lib/tcp-listener.c lib/tcp-listener.h lib/net.h modules/server.c modules/server.h) set_target_properties( p2p-2 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/p2p-2 ) set_target_properties( p2p-3 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/p2p-3 ) # Függvények kipróbálására hoztam létre diff --git a/docs/Doxyfile b/docs/Doxyfile index 75ca8d7..cf6a816 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -58,7 +58,7 @@ PROJECT_LOGO = # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = @PROJECT_SOURCE_DIR@\docs +OUTPUT_DIRECTORY = @PROJECT_SOURCE_DIR@/docs # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and @@ -790,7 +790,7 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = @PROJECT_SOURCE_DIR@ @PROJECT_SOURCE_DIR@\modules @PROJECT_SOURCE_DIR@\lib @PROJECT_SOURCE_DIR@\docs +INPUT = @PROJECT_SOURCE_DIR@ @PROJECT_SOURCE_DIR@/modules @PROJECT_SOURCE_DIR@/lib @PROJECT_SOURCE_DIR@/docs # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -1138,7 +1138,7 @@ HTML_FILE_EXTENSION = .html # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_HEADER = @PROJECT_SOURCE_DIR@\docs\doxygen-bootstrapped\header.html +HTML_HEADER = @PROJECT_SOURCE_DIR@/docs/doxygen-bootstrapped/header.html # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard @@ -1148,7 +1148,7 @@ HTML_HEADER = @PROJECT_SOURCE_DIR@\docs\doxygen-bootstrapped\header.h # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_FOOTER = @PROJECT_SOURCE_DIR@\docs\doxygen-bootstrapped\footer.html +HTML_FOOTER = @PROJECT_SOURCE_DIR@/docs/doxygen-bootstrapped/footer.html # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of @@ -1173,7 +1173,7 @@ HTML_STYLESHEET = # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_STYLESHEET = @PROJECT_SOURCE_DIR@\docs\doxygen-bootstrapped\customdoxygen.css +HTML_EXTRA_STYLESHEET = @PROJECT_SOURCE_DIR@/docs/doxygen-bootstrapped/customdoxygen.css # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note @@ -1183,7 +1183,7 @@ HTML_EXTRA_STYLESHEET = @PROJECT_SOURCE_DIR@\docs\doxygen-bootstrapped\customdo # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_FILES = @PROJECT_SOURCE_DIR@\docs\doxygen-bootstrapped\doxy-boot.js +HTML_EXTRA_FILES = @PROJECT_SOURCE_DIR@/docs/doxygen-bootstrapped/doxy-boot.js # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to diff --git a/docs/doxygen_entrydb_15306.tmp b/docs/doxygen_entrydb_15306.tmp new file mode 100644 index 0000000..e69de29 diff --git a/docs/doxygen_objdb_15306.tmp b/docs/doxygen_objdb_15306.tmp new file mode 100644 index 0000000..e69de29 diff --git a/htdocs/assets/js/chat.js b/htdocs/assets/js/chat.js index 7260b9b..00fe96a 100644 --- a/htdocs/assets/js/chat.js +++ b/htdocs/assets/js/chat.js @@ -30,10 +30,11 @@ function submitForm() { var fetch_messages = new XMLHttpRequest(); var url = "/peers/" +window.location.pathname+ ".txt"; - +var last_text =""; setInterval(function(){ fetch_messages.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) loadMessages(this.responseText.split("\n")); + last_text = this.responseText; }; fetch_messages.open("GET", url, true); fetch_messages.send(); @@ -65,7 +66,7 @@ function loadMessages(arr) { for(i = 0; i < arr.length; i++) { if(arr[i] == '') continue; if(arr[i].indexOf("Me:") == -1){ - out += '
' + joypixels.toImage(decodeURIComponent(arr[i].replaceAll('+',' '))) + '
' + joypixels.toImage(decodeURIComponent(arr[i].replaceAll('+',' '))) + '
' + joypixels.toImage((decodeURIComponent(msg.replaceAll('+',' ')))) + '