41 #include "http-strings.h"
42 #include "webserver.h"
48 static struct ctk_label message =
49 {
CTK_LABEL(0, 0, 15, 1,
"Latest requests")};
51 PROCESS(webserver_process,
"Web server");
53 AUTOSTART_PROCESSES(&webserver_process);
57 static char log[LOG_WIDTH*LOG_HEIGHT];
59 static struct ctk_label loglabel =
60 {
CTK_LABEL(0, 1, LOG_WIDTH, LOG_HEIGHT, log)};
66 ctk_window_new(&mainwindow, LOG_WIDTH, LOG_HEIGHT+1,
"Web server");
79 ev == PROCESS_EVENT_EXIT) {
92 webserver_log_file(uip_ipaddr_t *requester,
char *file)
97 memcpy(log, &log[LOG_WIDTH], LOG_WIDTH * (LOG_HEIGHT - 1));
100 size = sprintf(&log[LOG_WIDTH * (LOG_HEIGHT - 1)],
108 strncpy(&log[LOG_WIDTH * (LOG_HEIGHT - 1) + size], file, LOG_WIDTH - size);
115 webserver_log(
char *msg)
118 memcpy(log, &log[LOG_WIDTH], LOG_WIDTH * (LOG_HEIGHT - 1));
121 strncpy(&log[LOG_WIDTH * (LOG_HEIGHT - 1)], msg, LOG_WIDTH);
#define CTK_WIDGET_ADD(win, widg)
Add a widget to a window.
process_event_t ctk_signal_window_close
Emitted when a window is closed.
void ctk_window_open(CC_REGISTER_ARG struct ctk_window *w)
Open a window, or bring window to front if already open.
void ctk_window_close(struct ctk_window *w)
Close a window if it is open.
#define PROCESS_BEGIN()
Define the beginning of a process.
#define CTK_LABEL(x, y, w, h, text)
Instantiating macro for the ctk_label widget.
#define PROCESS_THREAD(name, ev, data)
Define the body of a process.
#define PROCESS_END()
Define the end of a process.
void ctk_window_new(struct ctk_window *window, unsigned char w, unsigned char h, char *title)
Create a new window.
#define LOADER_UNLOAD()
Unload a program from memory.
#define PROCESS_WAIT_EVENT()
Wait for an event to be posted to the process.
#define PROCESS(name, strname)
Declare a process.
process_event_t tcpip_event
The uIP event.
Representation of a CTK window.
#define CTK_WIDGET_REDRAW(widg)
Add a widget to the redraw queue.
void process_exit(struct process *p)
Cause a process to exit.