Added projects tab and local projects list processing. Fxed some memory errors

This commit is contained in:
Dm1tr1y147
2020-07-28 07:29:20 +05:00
parent 21f5a392fa
commit 440000c438
14 changed files with 251 additions and 15 deletions

View File

@ -0,0 +1,33 @@
#ifndef _ARTICLE_H
#define _ARTICLE_H
#include <stdio.h>
#include <time.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include "../../include/file_op/file.h"
#include "../../include/utils_op/utils.h"
#include "../../include/articles_p/process_md.h"
#define LINE_LENGTH 512
#ifndef _ARTICLE_INFO
#define _ARTICLE_INFO
typedef struct
{
char *title;
long time;
char *content;
unsigned long length;
} article_info;
#endif
int list_articles(article_info **articles);
long get_article_contents(article_info *article);
void free_article_info_arr(article_info **articles, int length);
#endif

23
include/articles_p/html.h Normal file
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

View File

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