Completely remove csv-db files and continued working on frontend. Created styles base

This commit is contained in:
2020-07-04 22:31:26 +05:00
parent cd874d6e28
commit 55f5ccfdf4
19 changed files with 153 additions and 571 deletions

View File

@ -1,26 +0,0 @@
#ifndef _ARTICLE_H
#define _ARTICLE_H
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "../../include/db_op/db.h"
#ifndef ARTICLE_T_TYPE
#define ARTICLE_T_TYPE
typedef struct {
unsigned int id;
char *header;
char *content;
char *author;
char *topic;
} article_t;
#endif
int expand_line_article(int n, char *buff, entry_s *rec);
char *serialize_article(entry_s *rec);
#endif

View File

@ -1,51 +0,0 @@
#ifndef _DB_H
#define _DB_H
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#ifndef ARTICLE_T_TYPE
#define ARTICLE_T_TYPE
typedef struct {
unsigned int id;
char *header;
char *content;
char *author;
char *topic;
} article_t;
#endif
typedef enum
{
BLOGPOST_T,
ARTICLE_T
} types;
typedef struct
{
types type;
union {
article_t a;
} data;
} entry_s;
#include "./article.h"
#define LINE_SIZE 512
int open_db(char *file_name, types type, FILE **file, char ***head, int *head_length);
int open_table(char *file_name, FILE **file);
int read_head(FILE *file, char ***head);
int get_entry(FILE *file, entry_s *rec, int n, int (*process_line)(int, char *, entry_s *));
int append_table(FILE *file, entry_s *rec, char *(*process_line)(entry_s *));
int remove_entry(FILE *file, int n);
int read_whole_table(FILE *file, entry_s **rec, int (*process_line)(int, char *, entry_s *));
int find_by(FILE *file, entry_s **entries, int (*check_line)(int, char *, entry_s), int (*process_line)(int, char *, entry_s));
#endif

View File

@ -1,8 +0,0 @@
#ifndef _DB_CLI_H
#define _DB_CLI_H
#include "../../include/db_op/db.h"
char *get_all_articles_list();
#endif