Compare commits
1 Commits
master
...
inja-templ
Author | SHA1 | Date | |
---|---|---|---|
|
2bde13ce1b |
@ -21,6 +21,7 @@ find_package(ZLIB REQUIRED)
|
||||
find_package(Iconv REQUIRED)
|
||||
|
||||
add_library(osse STATIC ${SRC_FILES})
|
||||
target_include_directories(osse PRIVATE extern)
|
||||
target_link_libraries(osse OpenSSL::SSL ZLIB::ZLIB Iconv::Iconv)
|
||||
|
||||
add_executable(gb src/main.cpp)
|
||||
|
@ -17,13 +17,13 @@ This does not build on ARM and does not work correctly on modern versions of Mac
|
||||
|
||||
## Debian or Ubuntu
|
||||
```
|
||||
sudo apt-get install make g++ libssl-dev libz-dev
|
||||
sudo apt-get install make g++ libssl-dev libz-dev cmake
|
||||
```
|
||||
|
||||
## RedHat or AlmaLinux
|
||||
I haven't tried this lately...
|
||||
```
|
||||
sudo yum install gcc-c++ openssl-devel
|
||||
sudo yum install gcc-c++ openssl-devel cmake
|
||||
```
|
||||
|
||||
# Issues & Pull Requests
|
||||
@ -32,3 +32,7 @@ Should be filed at https://github.com/twistdroach/open-source-search-engine
|
||||
# Documentation
|
||||
There are various docs located in the html directory. The FAQ & developer.html are particularly interesting.
|
||||
|
||||
# External
|
||||
These are external libraries used by OSSE:
|
||||
* [Inja template engine](https://github.com/pantor/inja)
|
||||
* [JSON for Modern C++](https://github.com/nlohmann/json)
|
||||
|
2937
extern/inja.hpp
vendored
Normal file
2937
extern/inja.hpp
vendored
Normal file
File diff suppressed because it is too large
Load Diff
24765
extern/nlohmann/json.hpp
vendored
Normal file
24765
extern/nlohmann/json.hpp
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@ -183,10 +183,13 @@ inline bool relabel ( void *ptr , int32_t size , const char *note ) {
|
||||
void operator delete ( void *p ) throw();
|
||||
void * operator new (size_t size) noexcept(false);
|
||||
// you MUST call mmalloc, mcalloc and mrealloc!!
|
||||
#define malloc coreme
|
||||
#define calloc coreme
|
||||
#define realloc coreme
|
||||
#define malloc coreme
|
||||
#define calloc coreme
|
||||
#define realloc coreme
|
||||
inline void *coreme ( int x ) { gbassert(false); return NULL; }
|
||||
namespace std {
|
||||
inline void *coreme ( int x ) { raise(SIGSEGV); return NULL; }
|
||||
}
|
||||
|
||||
int32_t getAllocSize(void *p);
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
#include "sort.h"
|
||||
#include "Users.h"
|
||||
|
||||
#include "inja.hpp"
|
||||
|
||||
static int defaultSort ( const void *i1, const void *i2 );
|
||||
static int pingSort1 ( const void *i1, const void *i2 );
|
||||
static int pingSort2 ( const void *i1, const void *i2 );
|
||||
@ -148,9 +150,12 @@ skipReplaceHost:
|
||||
cs);
|
||||
}
|
||||
|
||||
inja::json j;
|
||||
j["title"] = "test";
|
||||
// print host table
|
||||
if ( format == FORMAT_HTML )
|
||||
sb.safePrintf (
|
||||
sb.safePrintf (
|
||||
inja::render("This is a {{title}}<br>"
|
||||
"<table %s>"
|
||||
"<tr><td colspan=%s><center>"
|
||||
//"<font size=+1>"
|
||||
@ -268,7 +273,7 @@ skipReplaceHost:
|
||||
//"<td><b>inSync</td>",
|
||||
//"<td>avg roundtrip</td>"
|
||||
//"<td>std. dev.</td></tr>"
|
||||
"<td><b>note</b></td>",
|
||||
"<td><b>note</b></td>", j).c_str(),
|
||||
TABLE_STYLE ,
|
||||
colspan ,
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user