Merge pull request #151 from oliverschmidt/master

Reorganized web page attribute data handling.
This commit is contained in:
Oliver Schmidt 2013-03-06 07:34:07 -08:00
commit 8e05c80d96
12 changed files with 313 additions and 461 deletions

View file

@ -1,5 +1,4 @@
html_slasha "/a\0"
html_slashcenter "/center\0"
html_slashdiv "/div\0"
html_slashform "/form\0"
html_slashh "/h\0"
@ -9,7 +8,6 @@ html_slashstyle "/style\0"
html_a "a\0"
html_body "body\0"
html_br "br\0"
html_center "center\0"
html_form "form\0"
html_frame "frame\0"
html_h1 "h1\0"

View file

@ -1,9 +1,6 @@
const char html_slasha[4] =
/* "/a\0" */
{0x2f, 0x61, 00, };
const char html_slashcenter[9] =
/* "/center\0" */
{0x2f, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 00, };
const char html_slashdiv[6] =
/* "/div\0" */
{0x2f, 0x64, 0x69, 0x76, 00, };
@ -31,9 +28,6 @@ const char html_body[6] =
const char html_br[4] =
/* "br\0" */
{0x62, 0x72, 00, };
const char html_center[8] =
/* "center\0" */
{0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 00, };
const char html_form[6] =
/* "form\0" */
{0x66, 0x6f, 0x72, 0x6d, 00, };

View file

@ -1,5 +1,4 @@
extern const char html_slasha[4];
extern const char html_slashcenter[9];
extern const char html_slashdiv[6];
extern const char html_slashform[7];
extern const char html_slashh[4];
@ -9,7 +8,6 @@ extern const char html_slashstyle[8];
extern const char html_a[3];
extern const char html_body[6];
extern const char html_br[4];
extern const char html_center[8];
extern const char html_form[6];
extern const char html_frame[7];
extern const char html_h1[4];

View file

@ -160,7 +160,6 @@ struct htmlparser_state {
#if WWW_CONF_FORMS
char formaction[WWW_CONF_MAX_FORMACTIONLEN];
char formname[WWW_CONF_MAX_FORMNAMELEN];
unsigned char inputtype;
char inputname[WWW_CONF_MAX_INPUTNAMELEN];
char inputvalue[WWW_CONF_MAX_INPUTVALUELEN];
@ -177,57 +176,53 @@ static const char *tags[] = {
#define TAG_FIRST 0
#define TAG_SLASHA 0
html_slasha,
#define TAG_SLASHCENTER 1
html_slashcenter,
#define TAG_SLASHDIV 2
#define TAG_SLASHDIV 1
html_slashdiv,
#define TAG_SLASHFORM 3
#define TAG_SLASHFORM 2
html_slashform,
#define TAG_SLASHH 4
#define TAG_SLASHH 3
html_slashh,
#define TAG_SLASHSCRIPT 5
#define TAG_SLASHSCRIPT 4
html_slashscript,
#define TAG_SLASHSELECT 6
#define TAG_SLASHSELECT 5
html_slashselect,
#define TAG_SLASHSTYLE 7
#define TAG_SLASHSTYLE 6
html_slashstyle,
#define TAG_A 8
#define TAG_A 7
html_a,
#define TAG_BODY 9
#define TAG_BODY 8
html_body,
#define TAG_BR 10
#define TAG_BR 9
html_br,
#define TAG_CENTER 11
html_center,
#define TAG_FORM 12
#define TAG_FORM 10
html_form,
#define TAG_FRAME 13
#define TAG_FRAME 11
html_frame,
#define TAG_H1 14
#define TAG_H1 12
html_h1,
#define TAG_H2 15
#define TAG_H2 13
html_h2,
#define TAG_H3 16
#define TAG_H3 14
html_h3,
#define TAG_H4 17
#define TAG_H4 15
html_h4,
#define TAG_IMG 18
#define TAG_IMG 16
html_img,
#define TAG_INPUT 19
#define TAG_INPUT 17
html_input,
#define TAG_LI 20
#define TAG_LI 18
html_li,
#define TAG_P 21
#define TAG_P 19
html_p,
#define TAG_SCRIPT 22
#define TAG_SCRIPT 20
html_script,
#define TAG_SELECT 23
#define TAG_SELECT 21
html_select,
#define TAG_STYLE 24
#define TAG_STYLE 22
html_style,
#define TAG_TR 25
#define TAG_TR 23
html_tr,
#define TAG_LAST 26
#define TAG_LAST 24
last,
};
@ -258,7 +253,7 @@ htmlparser_init(void)
s.minorstate = MINORSTATE_TEXT;
s.lastchar = 0;
#if WWW_CONF_FORMS
s.formaction[0] = s.formname[0] = 0;
s.formaction[0] = 0;
#endif /* WWW_CONF_FORMS */
}
/*-----------------------------------------------------------------------------------*/
@ -336,31 +331,28 @@ find_tag(char *tag)
first = TAG_FIRST;
last = TAG_LAST;
i = 0;
do {
tagc = tag[i];
if((tagc == 0 || tagc == ISO_slash) &&
tags[first][i] == 0) {
if((tagc == 0 || tagc == ISO_slash) && tags[first][i] == 0) {
return first;
}
tabi = first;
/* First, find first matching tag from table. */
while(tagc > (tags[tabi])[i] &&
tabi < last) {
while(tagc > (tags[tabi])[i] && tabi < last) {
++tabi;
}
first = tabi;
/* Second, find last matching tag from table. */
while(tagc == (tags[tabi])[i] &&
tabi < last) {
while(tagc == (tags[tabi])[i] && tabi < last) {
++tabi;
}
last = tabi;
/* If first and last matching tags are equal, we have a non-match
and return. Else we continue with the next character. */
++i;
@ -377,8 +369,7 @@ parse_tag(void)
static char dummy;
PRINTF(("Parsing tag '%s' '%s' '%s'\n",
s.tag, s.tagattr, s.tagattrparam));
PRINTF(("Parsing tag '%s' '%s' '%s'\n", s.tag, s.tagattr, s.tagattrparam));
switch(find_tag(s.tag)) {
case TAG_P:
@ -386,14 +377,12 @@ parse_tag(void)
case TAG_H2:
case TAG_H3:
case TAG_H4:
/* parse_char(ISO_nl);*/
newline();
/* FALLTHROUGH */
case TAG_BR:
case TAG_TR:
case TAG_SLASHDIV:
case TAG_SLASHH:
/* parse_char(ISO_nl);*/
dummy = 0;
newline();
break;
@ -417,8 +406,7 @@ parse_tag(void)
s.majorstate = s.lastmajorstate = MAJORSTATE_BODY;
break;
case TAG_FRAME:
if(strncmp(s.tagattr, html_src, sizeof(html_src)) == 0 &&
s.tagattrparam[0] != 0) {
if(strncmp(s.tagattr, html_src, sizeof(html_src)) == 0 && s.tagattrparam[0] != 0) {
switch_majorstate(MAJORSTATE_BODY);
newline();
add_char(ISO_rbrack);
@ -430,25 +418,20 @@ parse_tag(void)
}
break;
case TAG_IMG:
if(strncmp(s.tagattr, html_alt, sizeof(html_alt)) == 0 &&
s.tagattrparam[0] != 0) {
/* parse_char(ISO_lt);*/
if(strncmp(s.tagattr, html_alt, sizeof(html_alt)) == 0 && s.tagattrparam[0] != 0) {
add_char(ISO_lt);
tagattrparam = &s.tagattrparam[0];
while(*tagattrparam) {
/* parse_char(*tagattrparam);*/
add_char(*tagattrparam);
++tagattrparam;
}
/* parse_char(ISO_gt);*/
add_char(ISO_gt);
do_word();
}
break;
case TAG_A:
PRINTF(("A %s %s\n", s.tagattr, s.tagattrparam));
if(strncmp(s.tagattr, html_href, sizeof(html_href)) == 0 &&
s.tagattrparam[0] != 0) {
if(strncmp(s.tagattr, html_href, sizeof(html_href)) == 0 && s.tagattrparam[0] != 0) {
strcpy(s.linkurl, s.tagattrparam);
do_word();
switch_majorstate(MAJORSTATE_LINK);
@ -464,72 +447,62 @@ parse_tag(void)
break;
#if WWW_CONF_FORMS
case TAG_FORM:
PRINTF(("Form tag\n"));
switch_majorstate(MAJORSTATE_FORM);
if(strncmp(s.tagattr, html_action, sizeof(html_action)) == 0) {
PRINTF(("Form action '%s'\n", s.tagattrparam));
strncpy(s.formaction, s.tagattrparam, WWW_CONF_MAX_FORMACTIONLEN - 1);
} else if(strncmp(s.tagattr, html_name, sizeof(html_name)) == 0) {
PRINTF(("Form name '%s'\n", s.tagattrparam));
strncpy(s.formname, s.tagattrparam, WWW_CONF_MAX_FORMNAMELEN - 1);
/* First check if we are called at the end of a form tag. If
so, we should propagate the form action. */
if(s.tagattr[0] == 0 && s.formaction[0] != 0) {
htmlparser_form(s.formaction);
init_input();
} else {
PRINTF(("Form tag\n"));
switch_majorstate(MAJORSTATE_FORM);
if(strncmp(s.tagattr, html_action, sizeof(html_action)) == 0) {
PRINTF(("Form action '%s'\n", s.tagattrparam));
strncpy(s.formaction, s.tagattrparam, WWW_CONF_MAX_FORMACTIONLEN - 1);
}
}
init_input();
break;
case TAG_SLASHFORM:
switch_majorstate(MAJORSTATE_BODY);
s.formaction[0] = s.formname[0] = 0;
s.formaction[0] = 0;
break;
case TAG_INPUT:
if(s.majorstate == MAJORSTATE_FORM) {
/* First check if we are called at the end of an input tag. If
so, we should render the input widget. */
if(s.tagattr[0] == 0 &&
s.inputname[0] != 0) {
if(s.tagattr[0] == 0 && s.inputname[0] != 0) {
PRINTF(("Render input type %d\n", s.inputtype));
switch(s.inputtype) {
case HTMLPARSER_INPUTTYPE_NONE:
case HTMLPARSER_INPUTTYPE_TEXT:
s.inputvalue[s.inputvaluesize] = 0;
htmlparser_inputfield(s.inputvaluesize, s.inputvalue, s.inputname,
s.formname, s.formaction);
htmlparser_inputfield(s.inputvaluesize, s.inputvalue, s.inputname);
break;
case HTMLPARSER_INPUTTYPE_SUBMIT:
case HTMLPARSER_INPUTTYPE_IMAGE:
htmlparser_submitbutton(s.inputvalue, s.inputname,
s.formname, s.formaction);
htmlparser_submitbutton(s.inputvalue, s.inputname);
break;
}
init_input();
} else {
PRINTF(("Input '%s' '%s'\n", s.tagattr, s.tagattrparam));
if(strncmp(s.tagattr, html_type, sizeof(html_type)) == 0) {
if(strncmp(s.tagattrparam, html_submit,
sizeof(html_submit)) == 0) {
if(strncmp(s.tagattrparam, html_submit, sizeof(html_submit)) == 0) {
s.inputtype = HTMLPARSER_INPUTTYPE_SUBMIT;
} else if(strncmp(s.tagattrparam, html_image,
sizeof(html_image)) == 0) {
} else if(strncmp(s.tagattrparam, html_image, sizeof(html_image)) == 0) {
s.inputtype = HTMLPARSER_INPUTTYPE_IMAGE;
} else if(strncmp(s.tagattrparam, html_text,
sizeof(html_text)) == 0) {
} else if(strncmp(s.tagattrparam, html_text, sizeof(html_text)) == 0) {
s.inputtype = HTMLPARSER_INPUTTYPE_TEXT;
} else {
s.inputtype = HTMLPARSER_INPUTTYPE_OTHER;
}
} else if(strncmp(s.tagattr, html_name,
sizeof(html_name)) == 0) {
strncpy(s.inputname, s.tagattrparam,
WWW_CONF_MAX_INPUTNAMELEN);
} else if(strncmp(s.tagattr, html_alt,
sizeof(html_alt)) == 0 &&
} else if(strncmp(s.tagattr, html_name, sizeof(html_name)) == 0) {
strncpy(s.inputname, s.tagattrparam, WWW_CONF_MAX_INPUTNAMELEN);
} else if(strncmp(s.tagattr, html_alt, sizeof(html_alt)) == 0 &&
s.inputtype == HTMLPARSER_INPUTTYPE_IMAGE) {
strncpy(s.inputvalue, s.tagattrparam,
WWW_CONF_MAX_INPUTVALUELEN);
} else if(strncmp(s.tagattr, html_value,
sizeof(html_value)) == 0) {
strncpy(s.inputvalue, s.tagattrparam,
WWW_CONF_MAX_INPUTVALUELEN);
} else if(strncmp(s.tagattr, html_size,
sizeof(html_size)) == 0) {
strncpy(s.inputvalue, s.tagattrparam, WWW_CONF_MAX_INPUTVALUELEN);
} else if(strncmp(s.tagattr, html_value, sizeof(html_value)) == 0) {
strncpy(s.inputvalue, s.tagattrparam, WWW_CONF_MAX_INPUTVALUELEN);
} else if(strncmp(s.tagattr, html_size, sizeof(html_size)) == 0) {
size = 0;
if(s.tagattrparam[0] >= '0' &&
s.tagattrparam[0] <= '9') {
@ -543,32 +516,15 @@ parse_tag(void)
size = WWW_CONF_MAX_INPUTVALUELEN - 1;
}
s.inputvaluesize = size;
/* strncpy(s.inputvalue, s.tagattrparam,
WWW_CONF_MAX_INPUTVALUELEN);*/
}
}
}
break;
#endif /* WWW_CONF_FORMS */
#if WWW_CONF_RENDERSTATE
case TAG_CENTER:
/* parse_char(ISO_nl); */
newline();
htmlparser_renderstate(HTMLPARSER_RENDERSTATE_BEGIN |
HTMLPARSER_RENDERSTATE_CENTER);
break;
case TAG_SLASHCENTER:
/* parse_char(ISO_nl);*/
newline();
htmlparser_renderstate(HTMLPARSER_RENDERSTATE_END |
HTMLPARSER_RENDERSTATE_CENTER);
break;
#endif /* WWW_CONF_RENDERSTATE */
#endif /* WWW_CONF_FORMS */
}
}
/*-----------------------------------------------------------------------------------*/
static uint16_t
static uint16_t CC_FASTCALL
parse_word(char *data, uint8_t dlen)
{
static uint8_t i;
@ -586,7 +542,6 @@ parse_word(char *data, uint8_t dlen)
} else if(c == ISO_lt) {
s.minorstate = MINORSTATE_TAG;
s.tagptr = 0;
/* do_word();*/
break;
} else if(c == ISO_ampersand) {
s.minorstate = MINORSTATE_EXTCHAR;
@ -599,11 +554,11 @@ parse_word(char *data, uint8_t dlen)
case MINORSTATE_EXTCHAR:
for(i = 0; i < len; ++i) {
c = data[i];
if(c == ISO_semicolon) {
if(c == ISO_semicolon) {
s.minorstate = MINORSTATE_TEXT;
add_char(' ');
break;
} else if(iswhitespace(c)) {
} else if(iswhitespace(c)) {
s.minorstate = MINORSTATE_TEXT;
add_char('&');
add_char(' ');
@ -622,7 +577,7 @@ parse_word(char *data, uint8_t dlen)
/* Full tag found. We continue parsing regular text. */
s.minorstate = MINORSTATE_TEXT;
s.tagattrptr = s.tagattrparamptr = 0;
endtagfound();
endtagfound();
parse_tag();
break;
} else if(iswhitespace(c)) {
@ -635,7 +590,6 @@ parse_word(char *data, uint8_t dlen)
} else {
/* Keep track of the name of the tag, but convert it to
lower case. */
s.tag[s.tagptr] = lowercase(c);
++s.tagptr;
/* Check if the ->tag field is full. If so, we just eat up
@ -645,7 +599,7 @@ parse_word(char *data, uint8_t dlen)
break;
}
}
/* Check for HTML comment, indicated by <!-- */
if(s.tagptr == 3 &&
s.tag[0] == ISO_bang &&
@ -684,8 +638,6 @@ parse_word(char *data, uint8_t dlen)
parse_tag();
s.minorstate = MINORSTATE_TAGATTRSPACE;
break;
/* s.tagattrptr = 0;
endtagfound();*/
}
} else if(c == ISO_eq) {
s.minorstate = MINORSTATE_TAGATTRPARAMNQ;
@ -733,29 +685,26 @@ parse_word(char *data, uint8_t dlen)
endtagfound();
parse_tag();
s.minorstate = MINORSTATE_TEXT;
s.tagattrptr = 0;
s.tagattrptr = 0;
endtagfound();
parse_tag();
s.tagptr = 0;
s.tagptr = 0;
endtagfound();
break;
} else if(iswhitespace(c) &&
s.tagattrparamptr == 0) {
/* Discard leading spaces. */
} else if(iswhitespace(c) && s.tagattrparamptr == 0) {
/* Discard leading spaces. */
} else if((c == ISO_citation ||
c == ISO_citation2) &&
s.tagattrparamptr == 0) {
c == ISO_citation2) && s.tagattrparamptr == 0) {
s.minorstate = MINORSTATE_TAGATTRPARAM;
s.quotechar = c;
PRINTF(("tag attr param q found\n"));
break;
} else if(iswhitespace(c)) {
PRINTF(("Non-leading space found at %d\n",
s.tagattrparamptr));
PRINTF(("Non-leading space found at %d\n", s.tagattrparamptr));
/* Stop parsing if a non-leading space was found */
endtagfound();
parse_tag();
s.minorstate = MINORSTATE_TAGATTR;
s.tagattrptr = 0;
endtagfound();
@ -781,7 +730,7 @@ parse_word(char *data, uint8_t dlen)
/* Found end of tag attr parameter. */
endtagfound();
parse_tag();
s.minorstate = MINORSTATE_TAGATTR;
s.tagattrptr = 0;
endtagfound();
@ -792,7 +741,7 @@ parse_word(char *data, uint8_t dlen)
} else {
s.tagattrparam[s.tagattrparamptr] = c;
}
++s.tagattrparamptr;
/* Check if the "tagattr" field is full. If so, we just eat
up any data left in the tag. */
@ -852,6 +801,6 @@ htmlparser_parse(char *data, uint16_t datalen)
}
datalen -= plen;
data += plen;
}
}
}
/*-----------------------------------------------------------------------------------*/

View file

@ -38,29 +38,15 @@
/* Callbacks. */
void htmlparser_link(char *text, unsigned char textlen, char *url);
void htmlparser_form(char *action);
void htmlparser_submitbutton(char *value,
char *name,
char *formname,
char *formaction);
char *name);
void htmlparser_inputfield(unsigned char size,
char *value,
char *name,
char *formname,
char *formaction);
char *name);
void htmlparser_newline(void);
void htmlparser_word(char *word, unsigned char wordlen);
void htmlparser_renderstate(unsigned char state);
#define HTMLPARSER_RENDERSTATE_STATUSMASK 0x80
#define HTMLPARSER_RENDERSTATE_BEGIN 0x00
#define HTMLPARSER_RENDERSTATE_END 0x80
#define HTMLPARSER_RENDERSTATE_NONE 0x00
#define HTMLPARSER_RENDERSTATE_CENTER 0x01
#define HTMLPARSER_RENDERSTATE_TABLE 0x02
#define HTMLPARSER_RENDERSTATE_TR 0x04
#define HTMLPARSER_RENDERSTATE_TD 0x08
#define HTMLPARSER_INPUTTYPE_NONE 0
#define HTMLPARSER_INPUTTYPE_TEXT 1

View file

@ -33,6 +33,7 @@
*/
#include <string.h>
#include <stddef.h>
#include "ctk/ctk.h"
#include "lib/ctk-textentry-cmdline.h"
@ -59,13 +60,11 @@
/* The array that holds the current URL. */
static char url[WWW_CONF_MAX_URLLEN + 1];
static char tmpurl[WWW_CONF_MAX_URLLEN + 1];
/* The array that holds the web page text. */
static char webpage[WWW_CONF_WEBPAGE_WIDTH *
WWW_CONF_WEBPAGE_HEIGHT + 1];
/* The CTK widgets for the main window. */
static struct ctk_window mainwindow;
@ -120,31 +119,45 @@ static char history[WWW_CONF_HISTORY_SIZE][WWW_CONF_MAX_URLLEN];
static char history_last;
#endif /* WWW_CONF_HISTORY_SIZE > 0 */
/* The CTK widget definitions for the hyperlinks and the char arrays
that hold the link URLs. */
struct formattribs {
char formaction[WWW_CONF_MAX_FORMACTIONLEN];
char formname[WWW_CONF_MAX_FORMNAMELEN];
#define FORMINPUTTYPE_SUBMITBUTTON 1
#define FORMINPUTTYPE_INPUTFIELD 2
unsigned char inputtype;
char inputname[WWW_CONF_MAX_INPUTNAMELEN];
char *inputvalue;
struct linkattrib {
struct ctk_hyperlink hyperlink;
char url[1];
};
union pagewidgetattrib {
char url[WWW_CONF_MAX_URLLEN];
struct inputattrib;
struct formattrib {
struct inputattrib *nextptr;
char action[1];
};
struct inputattrib {
struct inputattrib *nextptr;
struct formattrib *formptr;
struct ctk_widget widget;
};
struct textattrib {
struct inputattrib *nextptr;
struct formattrib *formptr;
struct ctk_textentry textentry;
char name[1];
};
struct submitattrib {
struct inputattrib *nextptr;
struct formattrib *formptr;
struct ctk_button button;
char name[1];
};
static char pageattribs[WWW_CONF_PAGEATTRIB_SIZE];
static char *pageattribptr;
#if WWW_CONF_FORMS
struct formattribs form;
static struct formattrib *formptr;
static struct inputattrib *currptr;
#endif /* WWW_CONF_FORMS */
};
static struct ctk_widget pagewidgets[WWW_CONF_MAX_NUMPAGEWIDGETS];
static union pagewidgetattrib pagewidgetattribs[WWW_CONF_MAX_NUMPAGEWIDGETS];
static unsigned char pagewidgetptr;
#if WWW_CONF_RENDERSTATE
static unsigned char renderstate;
#endif /* WWW_CONF_RENDERSTATE */
#define ISO_nl 0x0a
#define ISO_space 0x20
@ -172,7 +185,7 @@ PROCESS(www_process, "Web browser");
AUTOSTART_PROCESSES(&www_process);
static void formsubmit(struct formattribs *attribs);
static void CC_FASTCALL formsubmit(struct formattrib *form);
/*-----------------------------------------------------------------------------------*/
/* make_window()
@ -195,7 +208,7 @@ make_window(void)
CTK_WIDGET_ADD(&mainwindow, &sep2);
CTK_WIDGET_ADD(&mainwindow, &statustext);
pagewidgetptr = 0;
pageattribptr = pageattribs;
}
/*-----------------------------------------------------------------------------------*/
/* redraw_window():
@ -208,6 +221,29 @@ redraw_window(void)
ctk_window_redraw(&mainwindow);
}
/*-----------------------------------------------------------------------------------*/
static char * CC_FASTCALL
add_pageattrib(unsigned size)
{
char *ptr;
if(pageattribptr + size > pageattribs + sizeof(pageattribs)) {
return NULL;
}
ptr = pageattribptr;
pageattribptr += size;
return ptr;
}
/*-----------------------------------------------------------------------------------*/
#if WWW_CONF_FORMS
static void CC_FASTCALL
add_forminput(struct inputattrib *inputptr)
{
inputptr->nextptr = NULL;
currptr->nextptr = inputptr;
currptr = inputptr;
}
#endif /* WWW_CONF_FORMS */
/*-----------------------------------------------------------------------------------*/
static void
clear_page(void)
{
@ -237,7 +273,7 @@ start_loading(void)
clear_page();
}
/*-----------------------------------------------------------------------------------*/
static void
static void CC_FASTCALL
show_statustext(char *text)
{
ctk_label_set_text(&statustext, text);
@ -307,7 +343,7 @@ open_url(void)
} else {
file = "/";
}
#if UIP_UDP
/* Try to lookup the hostname. If it fails, we initiate a hostname
lookup and print out an informative message on the statusbar. */
@ -332,16 +368,16 @@ open_url(void)
redraw_window();
}
/*-----------------------------------------------------------------------------------*/
/* open_link(link):
/* set_link(link):
*
* Will format a link from the current web pages so that it suits the
* open_url() function and finally call it to open the requested URL.
* open_url() function.
*/
static void
open_link(char *link)
static void CC_FASTCALL
set_link(char *link)
{
char *urlptr;
register char *urlptr;
if(strncmp(link, http_http, 7) == 0) {
/* The link starts with http://. We just copy the contents of the
link into the url string and jump away. */
@ -365,7 +401,7 @@ open_link(char *link)
} else {
/* A fully relative link is found. We find the last slash in the
current URL and paste the link there. */
/* XXX: we should really parse any ../ in the link as well. */
for(urlptr = url + strlen(url);
urlptr != url && *urlptr != ISO_slash;
@ -373,12 +409,6 @@ open_link(char *link)
++urlptr;
strncpy(urlptr, link, WWW_CONF_MAX_URLLEN - (urlptr - url));
}
/* Open the URL. */
show_url();
open_url();
start_loading();
}
/*-----------------------------------------------------------------------------------*/
#if WWW_CONF_HISTORY_SIZE > 0
@ -423,7 +453,7 @@ PROCESS_THREAD(www_process, ev, data)
w = (struct ctk_widget *)data;
PROCESS_BEGIN();
/* Create the main window. */
memset(webpage, 0, sizeof(webpage));
ctk_window_new(&mainwindow, WWW_CONF_WEBPAGE_WIDTH,
@ -433,7 +463,7 @@ PROCESS_THREAD(www_process, ev, data)
strncpy(editurl, WWW_CONF_HOMEPAGE, sizeof(editurl));
#endif /* WWW_CONF_HOMEPAGE */
CTK_WIDGET_FOCUS(&mainwindow, &urlentry);
#if WWW_CONF_WITH_WGET
/* Create download dialog.*/
ctk_dialog_new(&wgetdialog, 38, 7);
@ -444,11 +474,11 @@ PROCESS_THREAD(www_process, ev, data)
#endif /* WWW_CONF_WITH_WGET */
ctk_window_open(&mainwindow);
while(1) {
PROCESS_WAIT_EVENT();
if(ev == tcpip_event) {
webclient_appcall(data);
} else if(ev == ctk_signal_widget_activate) {
@ -456,7 +486,7 @@ PROCESS_THREAD(www_process, ev, data)
w == (struct ctk_widget *)&urlentry) {
start_loading();
firsty = 0;
#if WWW_CONF_HISTORY_SIZE > 0
#if WWW_CONF_HISTORY_SIZE > 0
log_back();
#endif /* WWW_CONF_HISTORY_SIZE > 0 */
memcpy(url, editurl, WWW_CONF_MAX_URLLEN);
@ -497,18 +527,10 @@ PROCESS_THREAD(www_process, ev, data)
#endif /* WWW_CONF_WITH_WGET */
#if WWW_CONF_FORMS
} else {
/* Check form buttons */
for(i = 0; i < pagewidgetptr; ++i) {
if(&pagewidgets[i] == w) {
formsubmit(&pagewidgetattribs[i].form);
/* show_statustext(pagewidgetattribs[i].form.formaction);*/
/* PRINTF(("Formaction %s formname %s inputname %s\n",
pagewidgetattribs[i].form.formaction,
pagewidgetattribs[i].form.formname,
pagewidgetattribs[i].form.inputname));*/
break;
}
}
/* Assume form widget. */
struct inputattrib *input = (struct inputattrib *)
(((char *)w) - offsetof(struct inputattrib, widget));
formsubmit(input->formptr);
#endif /* WWW_CONF_FORMS */
}
} else if(ev == ctk_signal_hyperlink_activate) {
@ -516,12 +538,13 @@ PROCESS_THREAD(www_process, ev, data)
#if WWW_CONF_HISTORY_SIZE > 0
log_back();
#endif /* WWW_CONF_HISTORY_SIZE > 0 */
open_link(w->widget.hyperlink.url);
set_link(w->widget.hyperlink.url);
show_url();
open_url();
start_loading();
CTK_WIDGET_FOCUS(&mainwindow, &stopbutton);
/* ctk_window_open(&mainwindow);*/
} else if(ev == ctk_signal_hyperlink_hover) {
if(CTK_WIDGET_TYPE((struct ctk_widget *)data) ==
CTK_WIDGET_HYPERLINK) {
if(CTK_WIDGET_TYPE((struct ctk_widget *)data) == CTK_WIDGET_HYPERLINK) {
strncpy(statustexturl, w->widget.hyperlink.url,
sizeof(statustexturl));
petsciiconv_topetscii(statustexturl, sizeof(statustexturl));
@ -530,8 +553,7 @@ PROCESS_THREAD(www_process, ev, data)
#if UIP_UDP
} else if(ev == resolv_event_found) {
/* Either found a hostname, or not. */
if((char *)data != NULL &&
resolv_lookup((char *)data) != NULL) {
if((char *)data != NULL && resolv_lookup((char *)data) != NULL) {
open_url();
} else {
show_statustext("Host not found");
@ -551,7 +573,7 @@ PROCESS_THREAD(www_process, ev, data)
* "url" variable and the visible "editurl" (which is shown in the URL
* text entry widget in the browser window).
*/
static void
static void CC_FASTCALL
set_url(char *host, uint16_t port, char *file)
{
char *urlptr;
@ -617,15 +639,12 @@ void
webclient_connected(void)
{
start_loading();
clear_page();
show_statustext("Request sent...");
set_url(webclient_hostname(), webclient_port(), webclient_filename());
#if WWW_CONF_RENDERSTATE
renderstate = HTMLPARSER_RENDERSTATE_NONE;
#endif /* WWW_CONF_RENDERSTATE */
htmlparser_init();
}
/*-----------------------------------------------------------------------------------*/
@ -654,7 +673,7 @@ webclient_datahandler(char *data, uint16_t len)
/* Clear remaining parts of page. */
loading = 0;
}
if(data == NULL) {
loading = 0;
show_statustext("Done");
@ -664,32 +683,30 @@ webclient_datahandler(char *data, uint16_t len)
}
}
/*-----------------------------------------------------------------------------------*/
static void *
add_pagewidget(char *text, unsigned char len, unsigned char type,
unsigned char border)
static void CC_FASTCALL
add_pagewidget(char *text, unsigned char textlen, char *attrib, unsigned char type,
unsigned char border)
{
register struct ctk_widget *lptr;
register char *wptr;
char *wptr;
static unsigned char maxwidth;
static void *dataptr;
if(!loading) {
return NULL;
return;
}
if(len + border == 0) {
return NULL;
if(textlen + border == 0) {
return;
}
maxwidth = WWW_CONF_WEBPAGE_WIDTH - (1 + 2 * border);
/* If the text of the link is too long so that it does not fit into
the width of the current window, counting from the current x
coordinate, we first try to jump to the next line. */
if(len + x > maxwidth) {
if(textlen + x > maxwidth) {
htmlparser_newline();
if(!loading) {
return NULL;
return;
}
}
@ -697,114 +714,95 @@ add_pagewidget(char *text, unsigned char len, unsigned char type,
XXX: this is not really the right thing to do, we should probably
either make a link into a multiline link, or add multiple
buttons. But this will do for now. */
if(len > maxwidth) {
if(textlen > maxwidth) {
text[maxwidth] = 0;
len = maxwidth;
textlen = maxwidth;
}
dataptr = NULL;
if(firsty == pagey) {
unsigned char attriblen = strlen(attrib);
wptr = webpageptr;
/* To save memory, we'll copy the widget text to the web page
drawing area and reference it from there. */
wptr[0] = 0;
wptr += border;
memcpy(wptr, text, len);
wptr[len] = 0;
wptr[len + border] = ' ';
if(pagewidgetptr < WWW_CONF_MAX_NUMPAGEWIDGETS) {
dataptr = &pagewidgetattribs[pagewidgetptr];
lptr = &pagewidgets[pagewidgetptr];
switch(type) {
case CTK_WIDGET_HYPERLINK:
CTK_HYPERLINK_NEW((struct ctk_hyperlink *)lptr, x,
y + 3, len,
wptr, dataptr);
break;
case CTK_WIDGET_BUTTON:
CTK_BUTTON_NEW((struct ctk_button *)lptr, x,
y + 3, len,
wptr);
((struct formattribs *)dataptr)->inputvalue = wptr;
break;
case CTK_WIDGET_TEXTENTRY:
CTK_TEXTENTRY_NEW((struct ctk_textentry *)lptr, x,
y + 3, len, 1,
wptr, len);
((struct formattribs *)dataptr)->inputvalue = wptr;
memcpy(wptr, text, textlen);
wptr[textlen] = 0;
wptr[textlen + border] = ' ';
switch(type) {
case CTK_WIDGET_HYPERLINK: {
struct linkattrib *linkptr;
linkptr = (struct linkattrib *)add_pageattrib(sizeof(struct linkattrib) /* incl 1 attrib char */ + attriblen);
if(linkptr != NULL) {
CTK_HYPERLINK_NEW(&linkptr->hyperlink, x, y + 3, textlen, wptr, linkptr->url);
strcpy(linkptr->url, attrib);
CTK_WIDGET_SET_FLAG(&linkptr->hyperlink, CTK_WIDGET_FLAG_MONOSPACE);
CTK_WIDGET_ADD(&mainwindow, &linkptr->hyperlink);
}
break;
}
CTK_WIDGET_SET_FLAG(lptr, CTK_WIDGET_FLAG_MONOSPACE);
CTK_WIDGET_ADD(&mainwindow, lptr);
#if WWW_CONF_FORMS
case CTK_WIDGET_BUTTON: {
struct submitattrib *submitptr;
++pagewidgetptr;
submitptr = (struct submitattrib *)add_pageattrib(sizeof(struct submitattrib) /* incl 1 attrib char */ + attriblen);
if(submitptr != NULL) {
CTK_BUTTON_NEW((struct ctk_button *)&submitptr->button, x, y + 3, textlen, wptr);
add_forminput((struct inputattrib *)submitptr);
submitptr->formptr = formptr;
strcpy(submitptr->name, attrib);
CTK_WIDGET_SET_FLAG(&submitptr->button, CTK_WIDGET_FLAG_MONOSPACE);
CTK_WIDGET_ADD(&mainwindow, &submitptr->button);
}
break;
}
case CTK_WIDGET_TEXTENTRY: {
struct textattrib *textptr;
textptr = (struct textattrib *)add_pageattrib(sizeof(struct textattrib) /* incl 1 attrib char */ + attriblen + WWW_CONF_MAX_INPUTVALUELEN);
if(textptr != NULL) {
CTK_TEXTENTRY_NEW((struct ctk_textentry *)&textptr->textentry, x, y + 3, textlen, 1,
textptr->name + attriblen + 1, WWW_CONF_MAX_INPUTVALUELEN);
add_forminput((struct inputattrib *)textptr);
textptr->formptr = formptr;
strcpy(textptr->textentry.text, text);
strcpy(textptr->name, attrib);
CTK_WIDGET_SET_FLAG(&textptr->textentry, CTK_WIDGET_FLAG_MONOSPACE);
CTK_WIDGET_ADD(&mainwindow, &textptr->textentry);
}
break;
}
#endif /* WWW_CONF_FORMS */
}
}
/* Increase the x coordinate with the length of the link text plus
the extra space behind it and the CTK button markers. */
len = len + 1 + 2 * border;
x += len;
textlen = textlen + 1 + 2 * border;
x += textlen;
if(firsty == pagey) {
webpageptr += len;
webpageptr += textlen;
}
if(x == WWW_CONF_WEBPAGE_WIDTH) {
htmlparser_newline();
}
return dataptr;
}
/*-----------------------------------------------------------------------------------*/
#if WWW_CONF_RENDERSTATE
static void
centerline(char *wptr)
{
unsigned char spaces, i;
char *cptr;
register struct ctk_widget *linksptr;
cptr = wptr + WWW_CONF_WEBPAGE_WIDTH;
for(spaces = 0; spaces < WWW_CONF_WEBPAGE_WIDTH; ++spaces) {
if(*--cptr != 0) {
break;
}
}
spaces /= 2;
while(cptr >= wptr) {
*(cptr + spaces) = *cptr;
--cptr;
}
memset(wptr, ' ', spaces);
linksptr = pagewidgets;
for(i = 0; i < pagewidgetptr; ++i) {
if(CTK_WIDGET_YPOS(linksptr) == y + 2) {
linksptr->x += spaces;
linksptr->widget.hyperlink.text += spaces;
}
++linksptr;
}
}
#endif /* WWW_CONF_RENDERSTATE */
/*-----------------------------------------------------------------------------------*/
void
htmlparser_newline(void)
{
char *wptr;
if(pagey < firsty) {
++pagey;
x = 0;
return;
}
if(!loading) {
return;
}
@ -812,16 +810,10 @@ htmlparser_newline(void)
webpageptr += (WWW_CONF_WEBPAGE_WIDTH - x);
++y;
x = 0;
wptr = webpageptr - WWW_CONF_WEBPAGE_WIDTH;
petsciiconv_topetscii(wptr,
WWW_CONF_WEBPAGE_WIDTH);
#if WWW_CONF_RENDERSTATE
if(renderstate & HTMLPARSER_RENDERSTATE_CENTER) {
centerline(wptr);
}
#endif /* WWW_CONF_RENDERSTATE */
petsciiconv_topetscii(wptr, WWW_CONF_WEBPAGE_WIDTH);
if(y == WWW_CONF_WEBPAGE_HEIGHT) {
loading = 0;
webclient_close();
@ -831,7 +823,6 @@ htmlparser_newline(void)
void
htmlparser_word(char *word, unsigned char wordlen)
{
if(loading) {
if(wordlen + 1 > WWW_CONF_WEBPAGE_WIDTH - x) {
htmlparser_newline();
@ -855,127 +846,93 @@ htmlparser_word(char *word, unsigned char wordlen)
void
htmlparser_link(char *text, unsigned char textlen, char *url)
{
static char *linkurlptr;
linkurlptr = add_pagewidget(text, textlen, CTK_WIDGET_HYPERLINK, 0);
if(linkurlptr != NULL &&
strlen(url) < WWW_CONF_MAX_URLLEN) {
strcpy(linkurlptr, url);
}
add_pagewidget(text, textlen, url, CTK_WIDGET_HYPERLINK, 0);
}
/*-----------------------------------------------------------------------------------*/
#if WWW_CONF_RENDERSTATE
void
htmlparser_renderstate(unsigned char s)
{
if((s & HTMLPARSER_RENDERSTATE_STATUSMASK) ==
HTMLPARSER_RENDERSTATE_BEGIN) {
renderstate |= s & ~HTMLPARSER_RENDERSTATE_STATUSMASK;
} else {
renderstate &= ~(s & ~HTMLPARSER_RENDERSTATE_STATUSMASK);
}
}
#endif /* WWW_CONF_RENDERSTATE */
/*-----------------------------------------------------------------------------------*/
#if WWW_CONF_FORMS
void
htmlparser_submitbutton(char *text, char *name,
char *formname, char *formaction)
htmlparser_form(char *action)
{
register struct formattribs *form;
form = add_pagewidget(text, (unsigned char)strlen(text), CTK_WIDGET_BUTTON, 1);
if(form != NULL) {
strncpy(form->formaction, formaction, WWW_CONF_MAX_FORMACTIONLEN);
strncpy(form->formname, formname, WWW_CONF_MAX_FORMNAMELEN);
strncpy(form->inputname, name, WWW_CONF_MAX_INPUTNAMELEN);
form->inputtype = FORMINPUTTYPE_SUBMITBUTTON;
formptr = (struct formattrib *)add_pageattrib(sizeof(struct formattrib) + strlen(action));
if(formptr != NULL) {
formptr->nextptr = NULL;
currptr = (struct inputattrib *)formptr;
strcpy(formptr->action, action);
}
}
/*-----------------------------------------------------------------------------------*/
void
htmlparser_inputfield(unsigned char size, char *text, char *name,
char *formname, char *formaction)
htmlparser_submitbutton(char *text, char *name)
{
register struct formattribs *form;
form = add_pagewidget(text, size, CTK_WIDGET_TEXTENTRY, 1);
if(form != NULL) {
strncpy(form->formaction, formaction, WWW_CONF_MAX_FORMACTIONLEN);
strncpy(form->formname, formname, WWW_CONF_MAX_FORMNAMELEN);
strncpy(form->inputname, name, WWW_CONF_MAX_INPUTNAMELEN);
form->inputtype = FORMINPUTTYPE_INPUTFIELD;
}
add_pagewidget(text, (unsigned char)strlen(text), name, CTK_WIDGET_BUTTON, 1);
}
/*-----------------------------------------------------------------------------------*/
static void
formsubmit(struct formattribs *attribs)
void
htmlparser_inputfield(unsigned char size, char *text, char *name)
{
unsigned char i, j;
register char *urlptr, *valueptr;
register struct formattribs *faptr;
add_pagewidget(text, size, name, CTK_WIDGET_TEXTENTRY, 1);
}
/*-----------------------------------------------------------------------------------*/
static void CC_FASTCALL
add_query(char delimiter, char *string)
{
static char *query;
unsigned char length;
urlptr = &tmpurl[0];
if(delimiter == ISO_questionmark) {
query = url + strlen(url);
}
strncpy(urlptr, attribs->formaction, WWW_CONF_MAX_URLLEN);
tmpurl[WWW_CONF_MAX_URLLEN] = 0;
urlptr += strlen(urlptr);
*urlptr = ISO_questionmark;
++urlptr;
/* Construct an URL by finding all input field forms with the same
formname as the current submit button, and add the submit button
URL stuff as well. */
for(i = 0; i < pagewidgetptr; ++i) {
if(urlptr - &tmpurl[0] >= WWW_CONF_MAX_URLLEN) {
break;
}
length = strlen(string);
if(query - url + WWW_CONF_MAX_URLLEN - 1 /* delimiter */ < length) {
return;
}
faptr = &pagewidgetattribs[i].form;
if(strcmp(attribs->formaction, faptr->formaction) == 0 &&
strcmp(attribs->formname, faptr->formname) == 0 &&
(faptr->inputtype == FORMINPUTTYPE_INPUTFIELD ||
faptr == attribs)) {
*query++ = delimiter;
strcpy(query, string);
if(delimiter == ISO_eq) {
char *space = query;
/* Copy the name of the input field into the URL and append a
questionmark. */
strncpy(urlptr, faptr->inputname, WWW_CONF_MAX_URLLEN - strlen(tmpurl));
tmpurl[WWW_CONF_MAX_URLLEN] = 0;
urlptr += strlen(urlptr);
*urlptr = ISO_eq;
++urlptr;
/* Convert and copy the contents of the input field to the URL
and append an ampersand. */
valueptr = pagewidgets[i].widget.textentry.text;
petsciiconv_toascii(valueptr, WWW_CONF_MAX_INPUTVALUELEN);
for(j = 0; j < WWW_CONF_MAX_INPUTVALUELEN; ++j) {
if(urlptr - &tmpurl[0] >= WWW_CONF_MAX_URLLEN) {
break;
}
*urlptr = *valueptr;
if(*urlptr == ISO_space) {
*urlptr = ISO_plus;
}
if(*urlptr == 0) {
break;
}
++urlptr;
++valueptr;
}
*urlptr = ISO_ampersand;
++urlptr;
petsciiconv_toascii(query, length);
while((space = strchr(space, ISO_space)) != NULL) {
*space = ISO_plus;
}
}
--urlptr;
*urlptr = 0;
query += length;
}
/*-----------------------------------------------------------------------------------*/
static void CC_FASTCALL
formsubmit(struct formattrib *form)
{
struct inputattrib *inputptr;
char delimiter = ISO_questionmark;
set_link(form->action);
for(inputptr = form->nextptr; inputptr != NULL; inputptr = inputptr->nextptr) {
char *name;
char *value;
if(inputptr->widget.type == CTK_WIDGET_BUTTON) {
name = ((struct submitattrib *)inputptr)->name;
value = ((struct submitattrib *)inputptr)->button.text;
} else {
name = ((struct textattrib *)inputptr)->name;
value = ((struct textattrib *)inputptr)->textentry.text;
}
add_query(delimiter, name);
add_query(ISO_eq, value);
delimiter = ISO_ampersand;
}
#if WWW_CONF_HISTORY_SIZE > 0
log_back();
#endif /* WWW_CONF_HISTORY_SIZE > 0 */
open_link(tmpurl);
show_url();
open_url();
start_loading();
}
#endif /* WWW_CONF_FORMS */
/*-----------------------------------------------------------------------------------*/

View file

@ -41,31 +41,25 @@
#define WWW_CONF_WEBPAGE_HEIGHT 20
#endif
#ifndef WWW_CONF_HISTORY_SIZE
#define WWW_CONF_HISTORY_SIZE 40
#define WWW_CONF_HISTORY_SIZE 10
#endif
#ifndef WWW_CONF_MAX_URLLEN
#define WWW_CONF_MAX_URLLEN 200
#define WWW_CONF_MAX_URLLEN 300
#endif
#ifndef WWW_CONF_MAX_NUMPAGEWIDGETS
#define WWW_CONF_MAX_NUMPAGEWIDGETS 20
#endif
#ifndef WWW_CONF_RENDERSTATE
#define WWW_CONF_RENDERSTATE 1
#ifndef WWW_CONF_PAGEATTRIB_SIZE
#define WWW_CONF_PAGEATTRIB_SIZE 2000
#endif
#ifndef WWW_CONF_FORMS
#define WWW_CONF_FORMS 1
#endif
#ifndef WWW_CONF_MAX_FORMACTIONLEN
#define WWW_CONF_MAX_FORMACTIONLEN 200
#endif
#ifndef WWW_CONF_MAX_FORMNAMELEN
#define WWW_CONF_MAX_FORMNAMELEN 200
#define WWW_CONF_MAX_FORMACTIONLEN 150
#endif
#ifndef WWW_CONF_MAX_INPUTNAMELEN
#define WWW_CONF_MAX_INPUTNAMELEN 200
#define WWW_CONF_MAX_INPUTNAMELEN 50
#endif
#ifndef WWW_CONF_MAX_INPUTVALUELEN
#define WWW_CONF_MAX_INPUTVALUELEN 200
#define WWW_CONF_MAX_INPUTVALUELEN 100
#endif
PROCESS_NAME(www_process);

View file

@ -60,10 +60,8 @@
#define WWW_CONF_HISTORY_SIZE 4
#define WWW_CONF_MAX_URLLEN 78
#define WWW_CONF_MAX_NUMPAGEWIDGETS 20
#define WWW_CONF_RENDERSTATE 1
#define WWW_CONF_FORMS 1
#define WWW_CONF_MAX_FORMACTIONLEN 20
#define WWW_CONF_MAX_FORMNAMELEN 20
#define WWW_CONF_MAX_INPUTNAMELEN 20
#define WWW_CONF_MAX_INPUTVALUELEN 20

View file

@ -62,11 +62,6 @@
#define WWW_CONF_HISTORY_SIZE 0
#define WWW_CONF_MAX_URLLEN 80
#define WWW_CONF_MAX_NUMPAGEWIDGETS 20
#define WWW_CONF_RENDERSTATE 0
#define WWW_CONF_FORMS 0
#define WWW_CONF_MAX_FORMACTIONLEN 20
#define WWW_CONF_MAX_FORMNAMELEN 20
#define WWW_CONF_MAX_INPUTNAMELEN 20
#define WWW_CONF_MAX_INPUTVALUELEN 20
#endif /* __CONTIKI_CONF_H__ */

View file

@ -70,11 +70,6 @@
#define WWW_CONF_HISTORY_SIZE 0
#define WWW_CONF_MAX_URLLEN 78
#define WWW_CONF_MAX_NUMPAGEWIDGETS 20
#define WWW_CONF_RENDERSTATE 0
#define WWW_CONF_FORMS 0
#define WWW_CONF_MAX_FORMACTIONLEN 20
#define WWW_CONF_MAX_FORMNAMELEN 20
#define WWW_CONF_MAX_INPUTNAMELEN 20
#define WWW_CONF_MAX_INPUTVALUELEN 20
#endif /* __CONTIKI_CONF_H__ */

View file

@ -70,10 +70,8 @@
#define WWW_CONF_HISTORY_SIZE 4
#define WWW_CONF_MAX_URLLEN 80
#define WWW_CONF_MAX_NUMPAGEWIDGETS 20
#define WWW_CONF_RENDERSTATE 1
#define WWW_CONF_FORMS 1
#define WWW_CONF_MAX_FORMACTIONLEN 20
#define WWW_CONF_MAX_FORMNAMELEN 20
#define WWW_CONF_MAX_INPUTNAMELEN 20
#define WWW_CONF_MAX_INPUTVALUELEN 20

View file

@ -175,15 +175,5 @@ typedef unsigned long clock_time_t;
#define WWW_CONF_WEBPAGE_WIDTH 76
#define WWW_CONF_WEBPAGE_HEIGHT 30
#define WWW_CONF_HISTORY_SIZE 40
#define WWW_CONF_MAX_URLLEN 200
#define WWW_CONF_MAX_NUMPAGEWIDGETS 80
#define WWW_CONF_RENDERSTATE 1
#define WWW_CONF_FORMS 1
#define WWW_CONF_MAX_FORMACTIONLEN 200
#define WWW_CONF_MAX_FORMNAMELEN 200
#define WWW_CONF_MAX_INPUTNAMELEN 200
#define WWW_CONF_MAX_INPUTVALUELEN 240
#define WWW_CONF_PAGEVIEW 1
#endif /* __CONTIKI_CONF_H__ */