Commit e8e5d536 authored by Jan Köster's avatar Jan Köster
Browse files

solved merge conflicts

parents 7bd1da55 4ed21c03
Loading
Loading
Loading
Loading
+1 −9
Changes for CMakeLists.txt: 1 added line, 9 removed lines.
Original line number Diff line number Diff line
@@ -2,20 +2,12 @@ project(libhtmlpp)
cmake_minimum_required(VERSION 3.0)
enable_testing ()

include(CheckIncludeFileCXX)

find_package(systempp REQUIRED)

set(LIBV "1.0.0")
set(Upstream_VERSION 1.0.0)

set(CMAKE_CXX_FLAGS 
    "-fPIC\
    ${CMAKE_CXX_FLAGS} \
    -Wall \
    -nostdlib \
    -nodefaultlibs"
)
SET(CMAKE_CXX_FLAGS "-fPIC -Wall -nostdlib")

configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)

+0 −21
Changes for config.h.in: 0 added lines, 21 removed lines.
Original line number Diff line number Diff line
#define HTML_BLOCKSIZE 255

#if defined(_MSC_VER)
  #include <BaseTsd.h> 
  #define strerror_r(errno,buf,len) strerror_s(buf,len,errno)
  #ifndef ssize_t  
    typedef SSIZE_T ssize_t;
    #define ssize_t ptrdiff_t
  #endif
  #define MSVC
#else
  #include <sys/types.h>
#endif

#if defined(_MSC_VER) && _MSC_VER < 1900
  #ifndef EWOULDBLOCK
    #define EWOULDBLOCK WSAEWOULDBLOCK
  #endif
  #define snprintf(buf,len, format,...) _snprintf_s(buf, len,len, format, __VA_ARGS__)
  #define nullptr NULL
#endif

#define ${CMAKE_SYSTEM_NAME}
+4 −2
Changes for src/CMakeLists.txt: 4 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -14,13 +14,15 @@ set(libhtmlSrcs
)

add_library(htmlpp        SHARED ${libhtmlSrcs} )
target_compile_definitions(htmlpp PUBLIC -DSHARED)

add_library(htmlpp-static STATIC ${libhtmlSrcs} )

generate_export_header(htmlpp)


target_link_libraries(htmlpp systempp crt1)
target_link_libraries(htmlpp-static systempp crt1)    
target_link_libraries(htmlpp ${systempp_LIBRARIES} c)
target_link_libraries(htmlpp-static ${systempp_LIBRARIES} c)


SET(CMAKE_INSTALL_LIBDIR lib CACHE PATH "Output directory for libraries")
+2 −1
Changes for src/exception.cpp: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -25,7 +25,8 @@
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *******************************************************************************/

#include <stddef.h>
#include <stdlib.h>
#include <string.h>

#include "utils.h"
#include "exception.h"
+20 −14
Changes for src/html.cpp: 20 added lines, 14 removed lines.
Original line number Diff line number Diff line
@@ -25,10 +25,14 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************/

#include <stdio.h>
#include <stdlib.h>

#include <systempp/sysconsole.h>
#include <systempp/sysfile.h>
#include <systempp/sysutils.h>
#include <systempp/sysexception.h>
#include <systempp/config.h>

#include "utils.h"
#include "html.h"
@@ -43,6 +47,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define HTMLCOMMENT 2
#define HTMLHEADER 3

void *__dso_handle __attribute__((__visibility__("hidden"))) __attribute__((weak)) = &__dso_handle;

libhtmlpp::HtmlString::HtmlString(){
    _InitString();
    _HtmlHeader=nullptr;
@@ -50,8 +56,8 @@ libhtmlpp::HtmlString::HtmlString(){

libhtmlpp::HtmlString::HtmlString(char *header){
    _InitString();
    _HtmlHeader=new char[sys::getlen(header)+1];
    sys::scopy(header,header+sys::getlen(header)+1,_HtmlHeader);
    _HtmlHeader=new char[strlen(header)+1];
    sys::scopy(header,header+strlen(header)+1,_HtmlHeader);
}

libhtmlpp::HtmlString::~HtmlString(){
@@ -68,7 +74,7 @@ void libhtmlpp::HtmlString::push_back(const char src){
}

void libhtmlpp::HtmlString::assign(const char* src) {
    assign(src,sys::getlen(src));
    assign(src,strlen(src));
}

void libhtmlpp::HtmlString::insert(size_t pos, char src){
@@ -114,7 +120,7 @@ libhtmlpp::HtmlString &libhtmlpp::HtmlString::operator<<(const char* src){

libhtmlpp::HtmlString &libhtmlpp::HtmlString::operator<<(int src){
    char *buf=new char[sizeof(int)+1];
    sys::itoa(src,buf);
    itoa(src,buf);
    assign(buf);
    delete[] buf;
    return *this;
@@ -122,7 +128,7 @@ libhtmlpp::HtmlString &libhtmlpp::HtmlString::operator<<(int src){

libhtmlpp::HtmlString &libhtmlpp::HtmlString::operator<<(unsigned int src){
    char *buf=new char[sizeof(int)+1];
    sys::ultoa(src,buf);
    ultoa(src,buf);
    assign(buf);
    delete[] buf;
    return *this;
@@ -130,7 +136,7 @@ libhtmlpp::HtmlString &libhtmlpp::HtmlString::operator<<(unsigned int src){

libhtmlpp::HtmlString &libhtmlpp::HtmlString::operator<<(unsigned long src){
    char *buf=new char[sizeof(int)+1];
    sys::ultoa(src,buf);
    ultoa(src,buf);
    assign(buf);
    delete[] buf;
    return *this;
@@ -264,12 +270,12 @@ libhtmlpp::HtmlElement *libhtmlpp::HtmlString::_buildTree(HtmlElement *node,Html
        int ret=_serialzeTags(_HTable[pos][0],_HTable[pos][2],&tag,tagsize);
        if(node){
            if(ret==HTMLELEMENT){
                if(sys::ncompare(node->_Tag,sys::getlen(node->_Tag),
                if(sys::ncompare(node->_Tag,strlen(node->_Tag),
                                         tag,tagsize)==0){
                    node->_nextElement=parent;
                }
            }else if(ret==HTMLTERMELEMENT){
                if(!node->_Child && sys::ncompare(node->_Tag,sys::getlen(node->_Tag),
                if(!node->_Child && sys::ncompare(node->_Tag,strlen(node->_Tag),
                                                          tag,tagsize)==0){
                    parent=node->_nextElement;
                    node->_nextElement=nullptr;
@@ -435,9 +441,9 @@ const char *libhtmlpp::HtmlPage::printHtml(){
void libhtmlpp::HtmlPage::loadFile(const char* path){
    delete _HtmlDocument;
    _HtmlDocument= new HtmlString();
    sys::file fs;
//    sys::file fs;
    try{
        fs.open(path,0);
//        fs.open(path,0);
    }catch(sys::SystemException &e){
        HTMLException excp;
        throw excp[HTMLException::Critical] << e.what();
@@ -460,7 +466,7 @@ void libhtmlpp::HtmlPage::loadFile(const char* path){

void libhtmlpp::HtmlElement::setID(const char *id){
    HTMLException excp;
    if(!setter(id,sys::getlen(id),&_ID)){
    if(!setter(id,strlen(id),&_ID)){
        excp[HTMLException::Error] << "HtmlElement can't id: " << id;
        throw excp;        
    }
@@ -468,7 +474,7 @@ void libhtmlpp::HtmlElement::setID(const char *id){

void libhtmlpp::HtmlElement::setClass(const char *cname){
    HTMLException excp;
    if(!setter(cname,sys::getlen(cname),&_Class)){
    if(!setter(cname,strlen(cname),&_Class)){
        excp[HTMLException::Error] << "HtmlElement can't class name: " << cname;
        throw excp;          
    }
@@ -476,7 +482,7 @@ void libhtmlpp::HtmlElement::setClass(const char *cname){

void libhtmlpp::HtmlElement::setStyle(const char *css){
    HTMLException excp;
    if(!setter(css,sys::getlen(css),&_Style,":;(),+~'")){
    if(!setter(css,strlen(css),&_Style,":;(),+~'")){
        excp[HTMLException::Error] << "HtmlElement can't set Style: " << css;
        throw excp;          
    }
@@ -484,7 +490,7 @@ void libhtmlpp::HtmlElement::setStyle(const char *css){

void libhtmlpp::HtmlElement::setComment(const char* comment){
    HTMLException excp;
    if(!setter(comment,sys::getlen(comment),&_Style,":;(),+~'")){
    if(!setter(comment,strlen(comment),&_Style,":;(),+~'")){
        excp[HTMLException::Error] << "HtmlElement can't set Comment: " << comment;
        throw excp;          
    }    
Loading