SpriteHTTPD - embedded HTTP server with read-only filesystem and templating, originally developed for ESP8266, now stand-alone and POSIX compatible.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
spritehttpd/spritehttpd/include/httpd-platform.h

39 lines
1.1 KiB

#pragma once
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include "httpd-utils.h"
// opaque conn type struct
struct HttpdConnType;
typedef struct HttpdConnType HttpdConnType;
typedef HttpdConnType* ConnTypePtr;
struct httpd_thread_handle;
typedef struct httpd_thread_handle httpd_thread_handle_t;
struct httpd_options;
#define httpd_printf(fmt, ...) printf(fmt, ##__VA_ARGS__)
// Prototypes for porting
int httpdConnSendData(ConnTypePtr conn, char *buff, int len);
void httpdConnDisconnect(ConnTypePtr conn);
void httpdPlatDisableTimeout(ConnTypePtr conn);
void httpdPlatInit();
httpd_thread_handle_t* httpdPlatStart(struct httpd_options *opts);
void httpdPlatJoin(httpd_thread_handle_t * handle);
void httpdPlatLock();
void httpdPlatUnlock();
void* httpdPlatMalloc(size_t len);
void httpdPlatFree(void *ptr);
char* httpdPlatStrdup(const char *s);
void httpdPlatDelayMs(uint32_t ms);
void httpdPlatTaskEnd();
int httpdPlatEspfsRead(void *dest, uint32_t offset, size_t len);
void platHttpServerTask(void *pvParameters);
void* platHttpServerTaskPosix(void *pvParameters);