Line 7... |
Line 7... |
* COPYRIGHT: Software placed into the public domain by the author.
|
* COPYRIGHT: Software placed into the public domain by the author.
|
* Software 'as is' without warranty. Author liable for nothing.
|
* Software 'as is' without warranty. Author liable for nothing.
|
* DESCRIPTION:
|
* DESCRIPTION:
|
* Plasma TCP/IP HTTP Server
|
* Plasma TCP/IP HTTP Server
|
*--------------------------------------------------------------------*/
|
*--------------------------------------------------------------------*/
|
#ifdef WIN32
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <ctype.h>
|
|
#define _LIBC
|
|
#endif
|
|
#include "rtos.h"
|
#include "rtos.h"
|
#include "tcpip.h"
|
#include "tcpip.h"
|
#ifdef WIN32
|
#ifdef WIN32
|
#define UartPrintf printf
|
#define UartPrintf printf
|
#define OS_MQueueCreate(A,B,C) 0
|
#define OS_MQueueCreate(A,B,C) 0
|
Line 147... |
Line 140... |
#endif
|
#endif
|
if(length != HTML_LENGTH_LIST_END)
|
if(length != HTML_LENGTH_LIST_END)
|
{
|
{
|
if(length == HTML_LENGTH_CALLBACK)
|
if(length == HTML_LENGTH_CALLBACK)
|
{
|
{
|
IPFuncPtr funcPtr = (IPFuncPtr)(uint32)page;
|
IPCallbackPtr funcPtr = (IPCallbackPtr)(uint32)page;
|
funcPtr(socket, buf, bytes);
|
funcPtr(socket, buf, bytes);
|
return;
|
return;
|
}
|
}
|
if(length == 0)
|
if(length == 0)
|
length = (int)strlen(page);
|
length = (int)strlen(page);
|
Line 215... |
Line 208... |
{"/Footer", 0, "</BODY></HTML>"},
|
{"/Footer", 0, "</BODY></HTML>"},
|
{"/ ", 0, "<h2>Home Page</h2>Welcome! <a href='/other.htm'>Other</a>"
|
{"/ ", 0, "<h2>Home Page</h2>Welcome! <a href='/other.htm'>Other</a>"
|
" <a href='/cgi/myprog'>myprog</a>"},
|
" <a href='/cgi/myprog'>myprog</a>"},
|
{"/other.htm ", 0, "<h2>Other</h2>Other."},
|
{"/other.htm ", 0, "<h2>Other</h2>Other."},
|
//{"/binary/plasma.gif ", 1945, PlasmaGif},
|
//{"/binary/plasma.gif ", 1945, PlasmaGif},
|
{"/cgi/myprog", HTML_LENGTH_CALLBACK, (char*)MyProg},
|
{"/cgi/myprog", HTML_LENGTH_CALLBACK, (char*)(int)MyProg},
|
{"", HTML_LENGTH_LIST_END, NULL}
|
{"", HTML_LENGTH_LIST_END, NULL}
|
};
|
};
|
void HtmlInit(int UseFiles)
|
void HtmlInit(int UseFiles)
|
{
|
{
|
(void)UseFiles;
|
(void)UseFiles;
|