httpd.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef __HTTPD_H__
00036 #define __HTTPD_H__
00037
00038
00039 #include "contiki-net.h"
00040 #include "httpd-fs.h"
00041 #include "lib/petsciiconv.h"
00042
00043 struct httpd_state {
00044 unsigned char timer;
00045 struct psock sin, sout;
00046 struct pt outputpt, scriptpt;
00047 char inputbuf[50];
00048 char filename[20];
00049 char state;
00050 struct httpd_fs_file file;
00051 int len;
00052 char *scriptptr;
00053 int scriptlen;
00054 union {
00055 unsigned short count;
00056 void *ptr;
00057 } u;
00058 };
00059
00060 #define HTTPD_STRING_TYPE PROGMEM_TYPE
00061 #define PROGMEM_TYPE 1
00062 #define EEPROM_TYPE 2
00063
00064 #if HTTPD_STRING_TYPE==PROGMEM_TYPE
00065 #define HTTPD_STRING_ATTR PROGMEM
00066
00067 #define httpd_memcpy memcpy_P
00068 #define httpd_strcpy strcpy_P
00069 #define httpd_strcmp strcmp_P
00070 #define httpd_strncmp strncmp_P
00071 #define httpd_strlen strlen_P
00072 #define httpd_snprintf snprintf_P
00073 #elif HTTPD_STRING_TYPE==EEPROM_TYPE
00074 #define HTTPD_STRING_ATTR EEPROM
00075
00076 #define httpd_memcpy memcpy_E
00077 #define httpd_strcpy strcpy_E
00078 #define httpd_strcmp strcmp_E
00079 #define httpd_strncmp strncmp_E
00080 #define httpd_strlen strlen_E
00081 #define httpd_snprintf snprintf_E
00082 #else
00083 #define httpd_memcpy memcpy
00084 #define httpd_strcpy strcpy
00085 #define httpd_strcmp strcmp
00086 #define httpd_strncmp strncmp
00087 #define httpd_strlen strlen
00088 #define httpd_snprintf snprintf
00089 #endif
00090
00091 void httpd_init(void);
00092 void httpd_appcall(void *state);
00093
00094 #endif