diff --git a/lib/fort.c b/lib/fort.c index 127a5c6..df1bd2d 100644 --- a/lib/fort.c +++ b/lib/fort.c @@ -346,16 +346,6 @@ int buffer_wprintf(string_buffer_t *buffer, size_t buffer_row, wchar_t *buf, siz #include #include -struct fort_column_options { - int col_min_width; - enum ft_text_alignment align; -}; - -extern fort_column_options_t g_column_options; - -FT_INTERNAL -fort_column_options_t create_column_options(void); - #define OPTION_IS_SET(ft_opts, option) ((ft_opts) & (option)) #define OPTION_SET(ft_opts, option) ((ft_opts) |=(option)) #define OPTION_UNSET(ft_opts, option) ((ft_opts) &= ~((uint32_t)option)) @@ -498,8 +488,10 @@ size_t max_border_elem_strlen(struct fort_table_options *); FT_INTERNAL fort_table_options_t *create_table_options(void); +/* FT_INTERNAL fort_table_options_t *copy_table_options(const fort_table_options_t *option); +*/ FT_INTERNAL void destroy_table_options(fort_table_options_t *options); @@ -768,22 +760,6 @@ static int get_option_value_if_exists_otherwise_default(const struct fort_cell_o } -fort_column_options_t g_column_options = { - 0, /* col_min_width*/ - FT_ALIGNED_RIGHT, /* align */ -}; - - -FT_INTERNAL -fort_column_options_t create_column_options(void) -{ - fort_column_options_t result; - memset(&result, '\0', sizeof(result)); - memcpy(&result, &g_column_options, sizeof(result)); - return result; -} - - //#define DEFAULT_CELL_OPTION {FT_ROW_UNSPEC, FT_COLUMN_UNSPEC, 0, 0, 0} FT_INTERNAL fort_cell_opt_container_t *create_cell_opt_container(void) @@ -1327,11 +1303,11 @@ fort_table_options_t *create_table_options(void) return options; } - +/* FT_INTERNAL fort_table_options_t *copy_table_options(const fort_table_options_t *option) { - /* todo: normal implementation, do deep copy of col options */ + // todo: normal implementation, do deep copy of col options fort_table_options_t *new_opt = create_table_options(); if (new_opt == NULL) @@ -1349,6 +1325,7 @@ fort_table_options_t *copy_table_options(const fort_table_options_t *option) } return new_opt; } +*/ FT_INTERNAL @@ -3158,6 +3135,7 @@ size_t buffer_text_width(string_buffer_t *buffer) ++n; } } else { +#ifdef FT_HAVE_WCHAR while (1) { const wchar_t *beg = NULL; const wchar_t *end = NULL; @@ -3172,7 +3150,10 @@ size_t buffer_text_width(string_buffer_t *buffer) ++n; } +#endif /* FT_HAVE_WCHAR */ } + + return max_length; /* shouldn't be here */ } diff --git a/src/options.c b/src/options.c index 92a48ad..63e76d4 100644 --- a/src/options.c +++ b/src/options.c @@ -57,22 +57,6 @@ static int get_option_value_if_exists_otherwise_default(const struct fort_cell_o } -fort_column_options_t g_column_options = { - 0, /* col_min_width*/ - FT_ALIGNED_RIGHT, /* align */ -}; - - -FT_INTERNAL -fort_column_options_t create_column_options(void) -{ - fort_column_options_t result; - memset(&result, '\0', sizeof(result)); - memcpy(&result, &g_column_options, sizeof(result)); - return result; -} - - //#define DEFAULT_CELL_OPTION {FT_ROW_UNSPEC, FT_COLUMN_UNSPEC, 0, 0, 0} FT_INTERNAL fort_cell_opt_container_t *create_cell_opt_container(void) @@ -616,11 +600,11 @@ fort_table_options_t *create_table_options(void) return options; } - +/* FT_INTERNAL fort_table_options_t *copy_table_options(const fort_table_options_t *option) { - /* todo: normal implementation, do deep copy of col options */ + // todo: normal implementation, do deep copy of col options fort_table_options_t *new_opt = create_table_options(); if (new_opt == NULL) @@ -638,6 +622,7 @@ fort_table_options_t *copy_table_options(const fort_table_options_t *option) } return new_opt; } +*/ FT_INTERNAL diff --git a/src/options.h b/src/options.h index 8fdaf69..28b21f9 100644 --- a/src/options.h +++ b/src/options.h @@ -5,16 +5,6 @@ #include #include -struct fort_column_options { - int col_min_width; - enum ft_text_alignment align; -}; - -extern fort_column_options_t g_column_options; - -FT_INTERNAL -fort_column_options_t create_column_options(void); - #define OPTION_IS_SET(ft_opts, option) ((ft_opts) & (option)) #define OPTION_SET(ft_opts, option) ((ft_opts) |=(option)) #define OPTION_UNSET(ft_opts, option) ((ft_opts) &= ~((uint32_t)option)) @@ -157,8 +147,10 @@ size_t max_border_elem_strlen(struct fort_table_options *); FT_INTERNAL fort_table_options_t *create_table_options(void); +/* FT_INTERNAL fort_table_options_t *copy_table_options(const fort_table_options_t *option); +*/ FT_INTERNAL void destroy_table_options(fort_table_options_t *options); diff --git a/src/string_buffer.c b/src/string_buffer.c index 1742fa3..818234b 100644 --- a/src/string_buffer.c +++ b/src/string_buffer.c @@ -286,6 +286,7 @@ size_t buffer_text_width(string_buffer_t *buffer) ++n; } } else { +#ifdef FT_HAVE_WCHAR while (1) { const wchar_t *beg = NULL; const wchar_t *end = NULL; @@ -300,7 +301,10 @@ size_t buffer_text_width(string_buffer_t *buffer) ++n; } +#endif /* FT_HAVE_WCHAR */ } + + return max_length; /* shouldn't be here */ }