updated tabs etc
This commit is contained in:
@@ -27,8 +27,6 @@
|
|||||||
#include "llfs.h"
|
#include "llfs.h"
|
||||||
#include "lcd_api.h"
|
#include "lcd_api.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fn void wbe_init(void)
|
* @fn void wbe_init(void)
|
||||||
* @brief Initialise the http server. It also sets the beginning screen
|
* @brief Initialise the http server. It also sets the beginning screen
|
||||||
@@ -36,7 +34,6 @@
|
|||||||
*/
|
*/
|
||||||
void wbe_init(void);
|
void wbe_init(void);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fn int fs_open_custom(struct fs_file*, const char*)
|
* @fn int fs_open_custom(struct fs_file*, const char*)
|
||||||
* @brief Function is called when the frontend wants to reach/open a file
|
* @brief Function is called when the frontend wants to reach/open a file
|
||||||
@@ -48,7 +45,6 @@ void wbe_init(void);
|
|||||||
*/
|
*/
|
||||||
int fs_open_custom(struct fs_file* file, const char* name);
|
int fs_open_custom(struct fs_file* file, const char* name);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fn void fs_close_custom(struct fs_file*)
|
* @fn void fs_close_custom(struct fs_file*)
|
||||||
* @brief Called when closing files and endpoints
|
* @brief Called when closing files and endpoints
|
||||||
@@ -57,7 +53,6 @@ int fs_open_custom(struct fs_file* file, const char* name);
|
|||||||
*/
|
*/
|
||||||
void fs_close_custom(struct fs_file* file);
|
void fs_close_custom(struct fs_file* file);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fn void httpd_cgi_handler(struct fs_file*, const char*, int, char**, char**)
|
* @fn void httpd_cgi_handler(struct fs_file*, const char*, int, char**, char**)
|
||||||
* @brief When data is send from the frontend to the backend with the CGI
|
* @brief When data is send from the frontend to the backend with the CGI
|
||||||
@@ -72,7 +67,6 @@ void fs_close_custom(struct fs_file* file);
|
|||||||
*/
|
*/
|
||||||
void httpd_cgi_handler(struct fs_file* file, const char* uri, int num_parm, char** pc_param, char** pc_value);
|
void httpd_cgi_handler(struct fs_file* file, const char* uri, int num_parm, char** pc_param, char** pc_value);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fn void wbe_display(const char*, const uint32_t, const uint32_t, const char*)
|
* @fn void wbe_display(const char*, const uint32_t, const uint32_t, const char*)
|
||||||
* @brief Function displays the sentence, its color, the background and the given
|
* @brief Function displays the sentence, its color, the background and the given
|
||||||
@@ -85,5 +79,4 @@ void httpd_cgi_handler(struct fs_file* file, const char* uri, int num_parm, char
|
|||||||
*/
|
*/
|
||||||
void wbe_display(const char* txt, const uint32_t txt_color, const uint32_t background_color, const char* image);
|
void wbe_display(const char* txt, const uint32_t txt_color, const uint32_t background_color, const char* image);
|
||||||
|
|
||||||
|
|
||||||
#endif /* INC_WEBSITE_BACKEND_ */
|
#endif /* INC_WEBSITE_BACKEND_ */
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ static inline void wbe_build_infostring(const llfs_file_t* file_list, char* info
|
|||||||
static void wbe_decoding_url(const char* encoded, char* decoded);
|
static void wbe_decoding_url(const char* encoded, char* decoded);
|
||||||
static uint32_t wbe_color_value(const char* rgb);
|
static uint32_t wbe_color_value(const char* rgb);
|
||||||
|
|
||||||
|
|
||||||
void wbe_init(void) {
|
void wbe_init(void) {
|
||||||
|
|
||||||
httpd_init();
|
httpd_init();
|
||||||
@@ -25,16 +24,13 @@ void wbe_init(void) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int fs_open_custom(struct fs_file* file, const char* name) {
|
int fs_open_custom(struct fs_file* file, const char* name) {
|
||||||
|
|
||||||
|
|
||||||
// Variables
|
// Variables
|
||||||
llfs_file_t *wanted_file = llfs_file_open(name + 1);
|
llfs_file_t *wanted_file = llfs_file_open(name + 1);
|
||||||
size_t buffer_len = 0;
|
size_t buffer_len = 0;
|
||||||
static char image_stringbuffer[STR_MAX] = "";
|
static char image_stringbuffer[STR_MAX] = "";
|
||||||
|
|
||||||
|
|
||||||
// The wanted file was found in the filesystem
|
// The wanted file was found in the filesystem
|
||||||
if (wanted_file != NULL) {
|
if (wanted_file != NULL) {
|
||||||
|
|
||||||
@@ -52,7 +48,6 @@ int fs_open_custom(struct fs_file* file, const char* name) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The endpoint '/images.info' is called when the client wants to call for the
|
* The endpoint '/images.info' is called when the client wants to call for the
|
||||||
* information string that contains the names of the available images.
|
* information string that contains the names of the available images.
|
||||||
@@ -73,7 +68,6 @@ int fs_open_custom(struct fs_file* file, const char* name) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Endpoint when client wants to send information to the backend
|
// Endpoint when client wants to send information to the backend
|
||||||
if (strncmp(name, "/cgi", 3) == 0) {
|
if (strncmp(name, "/cgi", 3) == 0) {
|
||||||
|
|
||||||
@@ -133,7 +127,6 @@ static size_t wbe_get_images(char* images_string, size_t file_count_fs) {
|
|||||||
return strlen(images_string);
|
return strlen(images_string);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fn void wbe_build_infostring(const llfs_file_t*, char*, const size_t)
|
* @fn void wbe_build_infostring(const llfs_file_t*, char*, const size_t)
|
||||||
* @brief Function adds the names of the files in "file_list" and adds them in "infoStr".
|
* @brief Function adds the names of the files in "file_list" and adds them in "infoStr".
|
||||||
@@ -157,8 +150,6 @@ static inline void wbe_build_infostring(const llfs_file_t* file_list, char* info
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void httpd_cgi_handler(struct fs_file* file, const char* uri, int num_parm, char** pc_param, char** pc_value) {
|
void httpd_cgi_handler(struct fs_file* file, const char* uri, int num_parm, char** pc_param, char** pc_value) {
|
||||||
|
|
||||||
// Variables
|
// Variables
|
||||||
@@ -171,7 +162,6 @@ void httpd_cgi_handler(struct fs_file* file, const char* uri, int num_parm, char
|
|||||||
char s_vktxt[CLR_MAX]; // The color of the sentence. (in #RGB)
|
char s_vktxt[CLR_MAX]; // The color of the sentence. (in #RGB)
|
||||||
char s_vka[CLR_MAX]; // Color of the background. (also in #RGB)
|
char s_vka[CLR_MAX]; // Color of the background. (also in #RGB)
|
||||||
|
|
||||||
|
|
||||||
if (strcmp("/cgi", uri) == 0) {
|
if (strcmp("/cgi", uri) == 0) {
|
||||||
|
|
||||||
for (size_t i = 0; i < num_parm; ++i) {
|
for (size_t i = 0; i < num_parm; ++i) {
|
||||||
@@ -218,7 +208,6 @@ void httpd_cgi_handler(struct fs_file* file, const char* uri, int num_parm, char
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fn void wbe_decoding_url(const char*, char*)
|
* @fn void wbe_decoding_url(const char*, char*)
|
||||||
* @brief The given information from the CGI parameters are URL encoded.
|
* @brief The given information from the CGI parameters are URL encoded.
|
||||||
@@ -272,8 +261,6 @@ static void wbe_decoding_url(const char* encoded, char* decoded) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static uint32_t wbe_color_value(const char* rgb) {
|
static uint32_t wbe_color_value(const char* rgb) {
|
||||||
|
|
||||||
// Variables
|
// Variables
|
||||||
@@ -296,11 +283,8 @@ static uint32_t wbe_color_value(const char* rgb) {
|
|||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void wbe_display(const char* txt, const uint32_t txt_color, const uint32_t bg_color, const char* image) {
|
void wbe_display(const char* txt, const uint32_t txt_color, const uint32_t bg_color, const char* image) {
|
||||||
|
|
||||||
|
|
||||||
// Variables
|
// Variables
|
||||||
lcd_gif_t *gif;
|
lcd_gif_t *gif;
|
||||||
char *extension;
|
char *extension;
|
||||||
|
|||||||
Reference in New Issue
Block a user