Subversion Repositories Keine

Rev

Rev 7 | Rev 10 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7 Rev 8
Line 1... Line 1...
1
/* $Id: cgi.c 7 2024-09-11 15:46:04Z nishi $ */
1
/* $Id: cgi.c 8 2024-09-11 15:49:08Z nishi $ */
2
 
2
 
3
#include "../config.h"
3
#include "../config.h"
4
 
4
 
5
#include "kn_cgi.h"
5
#include "kn_cgi.h"
6
 
6
 
Line 48... Line 48...
48
			if(stat(path, &s) == 0) {
48
			if(stat(path, &s) == 0) {
49
				if(S_ISDIR(s.st_mode)) {
49
				if(S_ISDIR(s.st_mode)) {
50
					manpage_scan(path);
50
					manpage_scan(path);
51
				} else {
51
				} else {
52
					char* name = kn_strdup(nl[i]->d_name);
52
					char* name = kn_strdup(nl[i]->d_name);
53
					char* desc = kn_strdup("<No description detected>");
53
					char* desc = kn_strdup("<span class=\"reverse\"> &lt;No description detected&gt; </span>");
54
 
54
 
55
					int incr = 0;
55
					int incr = 0;
56
					FILE* f = fopen(path, "r");
56
					FILE* f = fopen(path, "r");
57
					char* b = malloc(s.st_size + 1);
57
					char* b = malloc(s.st_size + 1);
58
					b[s.st_size] = 0;
58
					b[s.st_size] = 0;
Line 212... Line 212...
212
		printf("Main");
212
		printf("Main");
213
	} else {
213
	} else {
214
		printf("%s", kn_get_query("page"));
214
		printf("%s", kn_get_query("page"));
215
	}
215
	}
216
	printf("</title>\n");
216
	printf("</title>\n");
217
	printf("		<style>\n");
217
	printf("		<style>\n");;
218
	printf("html {\n");
218
	printf("html {\n");
219
	printf("	background-color: #222222;\n");
219
	printf("	background-color: #222222;\n");
220
	printf("	color: #ffffff;\n");
220
	printf("	color: #ffffff;\n");
221
	printf("}\n");
221
	printf("}\n");
-
 
222
	printf("html, input, code {\n");
-
 
223
	printf("	font-size: 15px;\n");
-
 
224
	printf("}\n");
-
 
225
	printf(".reverse {\n");
-
 
226
	printf("	color: #222222;\n");
-
 
227
	printf("	background-color: #ffffff;\n");
-
 
228
	printf("}\n");
222
	printf("body {\n");
229
	printf("body {\n");
223
	printf("	width: 900px;\n");
230
	printf("	width: 900px;\n");
224
	printf("	margin: 0 auto;\n");
231
	printf("	margin: 0 auto;\n");
225
	printf("}\n");
232
	printf("}\n");
226
	printf("a:link {\n");
233
	printf("a:link {\n");