[C] Separated code in different files

This commit is contained in:
seleznevae
2018-01-17 21:22:57 +03:00
parent a4802cc737
commit d2798da48d
19 changed files with 1555 additions and 1274 deletions

View File

@@ -30,6 +30,9 @@ SOFTWARE.
#include <stddef.h>
#include <stdlib.h>
#include "options.h"
/*
* Determine compiler
*/
@@ -111,82 +114,8 @@ FORT_EXTERN const char* ft_to_string(const FTABLE *FORT_RESTRICT table);
enum TextAlignment
{
LeftAligned,
CenterAligned,
RightAligned
};
/*****************************************************************************
* TABLE BORDER
*****************************************************************************/
/*
* TL TT TT TT TV TT TT TT TV TB TB TB TR <----- TopSeparator
* LL IV IV RR
* LH IH IH IH II IH IH IH II IH IH IH RH <----- InsideSeparator
* LL IV IV RR
* BL BB BB BB BV BB BB BB BV BB BB BB BR <----- BottomSeparator
*/
enum HorSeparatorPos
{
TopSeparator,
InsideSeparator,
BottomSeparator
};
enum BorderItemPos
{
TL_bip = 0,
TT_bip = 1,
TV_bip = 2,
TR_bip = 3,
LL_bip = 4,
IV_bip = 5,
RR_bip = 6,
LH_bip = 7,
IH_bip = 8,
II_bip = 9,
RH_bip = 10,
BL_bip = 11,
BB_bip = 12,
BV_bip = 13,
BR_bip = 14,
BorderItemPosSize
};
struct vector;
typedef struct vector vector_t;
struct fort_column_options
{
int col_min_width;
enum TextAlignment align;
};
typedef struct fort_column_options fort_column_options_t;
struct fort_table_options
{
int cell_padding_top;
int cell_padding_bottom;
int cell_padding_left;
int cell_padding_right;
int cell_empty_string_height;
char border_chars[BorderItemPosSize];
char header_border_chars[BorderItemPosSize];
vector_t *col_options;
};
typedef struct fort_table_options fort_table_options_t;
typedef fort_table_options_t context_t;
FORT_EXTERN int ft_set_default_options(const fort_table_options_t *options);
FORT_EXTERN int ft_get_default_options(fort_table_options_t *options);