Some more refactores, added articles functionality to web server

This commit is contained in:
2020-07-04 16:41:24 +05:00
parent 4c61d24352
commit cd874d6e28
11 changed files with 238 additions and 80 deletions

View File

@@ -26,4 +26,7 @@ typedef struct
#endif
int list_articles(article_info **articles);
long get_article_contents(article_info *article);
#endif

View File

@@ -0,0 +1,23 @@
#ifndef _HTML_H
#define _HTML_H
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#ifndef _ARTICLE_INFO
#define _ARTICLE_INFO
typedef struct
{
char *title;
long time;
char *content;
unsigned long length;
} article_info;
#endif
int gen_html_article(article_info article, char **out);
int gen_html_article_list(article_info *articles, int n, char **out);
#endif