From 3017f704d92190967815066ae686354fd5bf4edc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Wed, 6 Jul 2022 19:28:13 +0200 Subject: 0.0.23 --- src/hp.html | 10 +++++++--- src/httpd.c | 9 +++++++-- src/ico.ico | Bin 0 -> 1150 bytes src/icon.c | 12 ++++++++++++ src/main.c | 3 +++ src/osdd.xml | 5 +++-- 6 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 src/ico.ico create mode 100755 src/icon.c (limited to 'src') diff --git a/src/hp.html b/src/hp.html index 050c8dd..09bd680 100644 --- a/src/hp.html +++ b/src/hp.html @@ -9,13 +9,12 @@ - - +
- + @@ -30,6 +29,11 @@

sear.c +

+ diff --git a/src/httpd.c b/src/httpd.c index efebd75..abe025a 100644 --- a/src/httpd.c +++ b/src/httpd.c @@ -149,8 +149,8 @@ enum MHD_Result sc_httpd (void * cls, content_type = "text/plain"; break; case 'o': /* osdd.xml - opensearch description document */ - response = malloc(strlen(sc_osdd)+strlen(host)); - sprintf(response, sc_osdd, host); + response = malloc(strlen(sc_osdd)+strlen(host)*3); + sprintf(response, sc_osdd, host, host, host); content_type = "application/opensearchdescription+xml"; break; case 'c': /* css.css - stylesheets */ @@ -158,6 +158,11 @@ enum MHD_Result sc_httpd (void * cls, response = sc_css; content_type = "text/css"; break; + case 'f': /* favicon.ico */ + mhdrmm = MHD_RESPMEM_PERSISTENT; + response = (char *) sc_ico; + content_type = "image/x-icon"; + break; case 'l': /* logs.html */ { #ifdef SC_LOGMEM diff --git a/src/ico.ico b/src/ico.ico new file mode 100644 index 0000000..6d3265d Binary files /dev/null and b/src/ico.ico differ diff --git a/src/icon.c b/src/icon.c new file mode 100755 index 0000000..0611086 --- /dev/null +++ b/src/icon.c @@ -0,0 +1,12 @@ +#include +#define sear_width 16 +#define sear_height 16 +static unsigned char sear_bits[] = { + 0x00, 0x00, 0x0c, 0x07, 0x92, 0x08, 0x44, 0x10, 0x29, 0x24, 0x26, 0x28, + 0x20, 0x24, 0x40, 0x10, 0xc0, 0x08, 0x60, 0x07, 0x30, 0x00, 0x18, 0x30, + 0x0c, 0x08, 0x06, 0x08, 0x00, 0x32, 0x00, 0x00}; +int main (void) { + printf("P5 16 16 1\n"); + for (unsigned i = 0; i < sizeof(sear_bits)*8; i++) + putchar(sear_bits[i/8] & 1 << i % 8 ? 0 : 1); +} diff --git a/src/main.c b/src/main.c index e03b0c2..5a30742 100644 --- a/src/main.c +++ b/src/main.c @@ -61,6 +61,9 @@ char sc_osdd[] = { /* xml document for opensearch */ char sc_css[] = { /* css */ #include }; +unsigned char sc_ico[] = { +#include +}; char sc_robotstxt[] = "User-Agent: *\nDisallow: /\n"; char sc_securitytxt[] = "# This content information is provided by the developer of this opensource application.\n" "# The developer is not responsible for the actions of his software\n" diff --git a/src/osdd.xml b/src/osdd.xml index 9522910..21b7bf4 100644 --- a/src/osdd.xml +++ b/src/osdd.xml @@ -2,7 +2,8 @@ - sear.c - sear.c + sear.c @ %s + sear.c @ %s + data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAA////////////AAAA/wAAAP////////////////8AAAD/AAAA////////////////////////////////////////////AAAA/////////////////////////////////wAAAP8AAAD//////////////////////////////////////wAAAP//////////////////////////////////////AAAA/wAAAP//////////////////////////////////////AAAA/wAAAP////////////////////////////////8AAAD/AAAA/////////////////////////////////////////////////////////////////////////////////wAAAP8AAAD//////wAAAP8AAAD/AAAA////////////////////////////////////////////////////////////AAAA/wAAAP////////////////8AAAD//////////////////////////////////////////////////////wAAAP///////////////////////////wAAAP///////////////////////////////////////////wAAAP//////////////////////AAAA////////////AAAA/////////////////wAAAP8AAAD///////////8AAAD///////////////////////////8AAAD//////wAAAP///////////wAAAP///////////wAAAP//////AAAA//////////////////////8AAAD///////////8AAAD//////////////////////wAAAP////////////////8AAAD///////////////////////////8AAAD//////////////////////wAAAP///////////wAAAP///////////wAAAP////////////////8AAAD/////////////////////////////////AAAA/wAAAP//////////////////////AAAA/wAAAP8AAAD/////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== -- cgit v1.2.3