2489 MEMSPACE int is_cgitoken_char(int c)
test to see if a character is a valid member of the CGI token character set CGI tokens have the follo...
MEMSPACE WEAK_ATR char * strncat(char *dest, const char *src, size_t max)
Append string of at most N bytes from src.
MEMSPACE int atodigit(int c, int radix)
Convert ASCII character to radix based digit , or -1.
MEMSPACE char * meminit(mem_t *p, char *ptr, int size)
in memory memory gets function
MEMSPACE char * http_value(hinfo_t *hi, char *str)
Lookup and argument name and return its value.
MEMSPACE char * memgets(mem_t *p)
Memory gets function We ASSUME we can replace any with a \0.
MEMSPACE rwbuf_t * rwbuf_create()
Create socket read/write buffer for a connection.
MEMSPACE int vsnprintf(char *str, size_t size, const char *format, va_list va)
vsnprintf function
#define BUFFER_SIZE
max size of read/write socket buffers Note: reducing this size below 1500 will slow down transfer a g...
MEMSPACE void rwbuf_rinit(rwbuf_t *p)
Initialize socket read status and read index.
MEMSPACE size_t WEAK_ATR strlen(const char *str)
String Length.
MEMSPACE int find_cgitoken_start(char *str)
Find start of CGI token in a string CGI tokens have the following syntax @ They start with "@_" and e...
Master include file for project Includes all project includes and defines here.
static MEMSPACE void web_data_disconnect_callback(void *arg)
Network disconnect callback function.
MEMSPACE int write_byte(rwbuf_t *p, int c)
Write a byte (buffered) using the rwbuf_t socket buffers for this connection If the buffers are full ...
char * http_status[]
HTTP status code messages.
static MEMSPACE void _write_byte_fn(struct _printf_t *pr, char c)
low level vsock_printf function that calls socket write_byte
MEMSPACE int vsock_printf(rwbuf_t *p, const char *fmt, va_list va)
vsock_printf function
MEMSPACE void write_len(rwbuf_t *p, char *str, int len)
Write data using buffered write_byte function.
MEMSPACE void html_head(rwbuf_t *p, int status, char type, int len)
Write HTTP Contenet-Type/Content-Length header.
MEMSPACE char * mime_type(int type)
return strung pointer for mime type index
MEMSPACE void _printf_fn(printf_t *fn, __memx const char *fmt, va_list va)
vsnprintf function
MEMSPACE rwbuf_t * find_connection(espconn_t *conn, int *index, char *msg)
Find a read/write socket buffer for an espconn connection.
#define MAX_MSG
max size of ERROR/REDIRECT/STATUS Message buffer
static MEMSPACE void web_data_sent_callback(void *arg)
Network sent callback function.
MEMSPACE int sock_printf(rwbuf_t *p, const char *fmt,...)
sock_printf function
MEMSPACE int WEAK_ATR strcasecmp(const char *str, const char *pat)
Compare two strings without case.
#define snprintf(s, size, format, args...)
MEMSPACE char * next_arg(hinfo_t *hi)
Find next POST/GET argument We have to skip a name and a value.
espconn_t WebConn
Master espconn structure of the web server.
MEMSPACE char * process_args(hinfo_t *hi, char *ptr)
Process GET argments or POST message name/value data. HTML encoding is done in place often reducting ...
MEMSPACE char * first_arg(hinfo_t *hi)
Find first POST/GET argument.
void optimistic_yield(uint32_t interval_us)
MEMSPACE int file_type(char *name)
Determin mimetype using file name extension.
MEMSPACE int is_header(char *str, char **p)
Does the string look like a header token with a ':' ?
int putchar(int c)
put a character to stdout See fdevopen() sets stream->put get for TTY devices
Small web server for esp8266.
MEMSPACE char * nextbreak(char *ptr)
Find next space or ? character.
header_t msg_headers[]
HTTP headers we understand.
MEMSPACE rwbuf_t * create_connection(espconn_t *conn)
Allocate read/write socket buffers and add it to the working pool.
static MEMSPACE void web_data_receive_callback(void *arg, char *data, unsigned short length)
Network receive callback function.
static MEMSPACE void web_data_connect_callback(espconn_t *conn)
incomming connection setup callbacks
MEMSPACE void led_off(int led)
Turn off virtual LED.
MEMSPACE void write_str(rwbuf_t *p, char *str)
Write string using buffered write_byte function.
MEMSPACE int write_buffer(rwbuf_t *p)
Socket write buffer for this connection We wait for previous send to complete - then send any new dat...
MEMSPACE void trim_tail(char *str)
Trim White space and control characters from end of string.
MEMSPACE int MATCHI_LEN(char *str, char *pat)
Compare two strings without case limted to length of pattern.
MEMSPACE void display_ipv4(char *msg, uint8_t *ip, int port)
Display IPV4 address.
MEMSPACE void led_on(int led)
MEMSPACE int html_msg(rwbuf_t *p, int status, char type, char *fmt,...)
Send an HTML status message to socket.
MEMSPACE char * nextspace(char *ptr)
Skip to first white space in a string - tabs and spaces.
MEMSPACE void init_hinfo(hinfo_t *hi)
MEMSPACE void web_sep(void)
printer seperator
MEMSPACE char * html_status(int status)
Convert html status into string using http_status table.
MEMSPACE int wait_send(rwbuf_t *p)
Wait for buffer to send for this connection If write_buffer sending flag is set then wait for it to c...
static MEMSPACE void tcp_accept(espconn_t *esp_config, esp_tcp *esp_tcp_config, uint16_t port, void(*connect_callback)(struct espconn *))
Accept an incomming connection, setup connect_callback.
MEMSPACE int match_headers(char *str, char **p)
Match GET/POST message headers.
MEMSPACE int delete_connection(rwbuf_t *p)
Delete our main connection structure and connection buffers.
MEMSPACE void u5toa(char *ptr, uint16_t num)
Print a decimal number into a string without an EOS.
MEMSPACE int printf(const char *format,...)
MEMSPACE int write_flush(rwbuf_t *p)
Write all outstanding data and wait for it to send.
ili9341 driver inspired by Adafruit ili9341 code All code in this file has been rewritten by Mike Gor...
MEMSPACE char * arg_value(hinfo_t *hi)
Return the argument value for current argument.
MEMSPACE void safefree(void *p)
Safe free - Only free a pointer if it is in malloc memory range. We want to try to catch frees of sta...
MEMSPACE void rwbuf_delete(rwbuf_t *p)
Delete socket read/write buffers.
static MEMSPACE void web_data_error_callback(void *arg, int8_t err)
Network Error callback function.
rwbuf_t * web_connections[MAX_CONNECTIONS]
socket buffers for this connection
MEMSPACE void rwbuf_winit(rwbuf_t *p)
Initialize socket send status and write index.
MEMSPACE char * arg_name(hinfo_t *hi)
Return the argument name for current argument.
MEMSPACE int parse_http_request(rwbuf_t *p, hinfo_t *hi)
Get arguments for a GET or POST request.
MEMSPACE int atoi(const char *str)
Convert ASCII string to number in base 10.
void(* put)(struct _printf_t *, char)
static MEMSPACE _led
Turn on virtual LED.
MEMSPACE void * safecalloc(size_t nmemb, size_t size)
Safe Calloc - Display Error message if Calloc fails.
MEMSPACE char * skipspaces(char *ptr)
Skip white space in a string - tabs and spaces.
mime_t mimes[]
MIME types.
undefine any potential macro version of these functions
static esp_tcp WebTcp
Master network configuration for the web server.