libfort
fort.h
Go to the documentation of this file.
1 /*
2 libfort
3 
4 MIT License
5 
6 Copyright (c) 2017 - 2020 Seleznev Anton
7 
8 Permission is hereby granted, free of charge, to any person obtaining a copy
9 of this software and associated documentation files (the "Software"), to deal
10 in the Software without restriction, including without limitation the rights
11 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 copies of the Software, and to permit persons to whom the Software is
13 furnished to do so, subject to the following conditions:
14 
15 The above copyright notice and this permission notice shall be included in all
16 copies or substantial portions of the Software.
17 
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 SOFTWARE.
25 */
26 
35 #ifndef LIBFORT_H
36 #define LIBFORT_H
37 
38 #include <stddef.h>
39 #include <stdlib.h>
40 #include <stdint.h>
41 #include <limits.h>
42 
43 /*****************************************************************************
44  * VERSION
45  *****************************************************************************/
46 
47 #define LIBFORT_MAJOR_VERSION 0
48 #define LIBFORT_MINOR_VERSION 4
49 #define LIBFORT_REVISION 2
50 #define LIBFORT_VERSION_STR "0.4.2"
51 
52 
53 /*****************************************************************************
54  * Configuration
55  *****************************************************************************/
56 
64 #if !defined(FT_CONGIG_DISABLE_WCHAR)
65 #define FT_HAVE_WCHAR
66 #endif
67 
68 #if !defined(FT_CONGIG_DISABLE_UTF8)
69 #define FT_HAVE_UTF8
70 #endif
71 
72 
73 /*****************************************************************************
74  * RETURN CODES
75  *****************************************************************************/
76 
80 #define FT_SUCCESS 0
81 
85 #define FT_MEMORY_ERROR -1
86 
90 #define FT_EINVAL -2
91 
99 #define FT_INTERN_ERROR -3
100 
107 #define FT_GEN_ERROR -4
108 
109 
110 #define FT_IS_SUCCESS(arg) ((arg) >= 0)
111 #define FT_IS_ERROR(arg) ((arg) < 0)
112 
113 
114 
115 
120 /*****************************************************************************
121  * Determine compiler
122  *****************************************************************************/
123 
124 #if defined(__clang__)
125 #define FT_CLANG_COMPILER
126 #elif defined(__GNUC__)
127 #define FT_GCC_COMPILER
128 #elif defined(_MSC_VER)
129 #define FT_MICROSOFT_COMPILER
130 #else
131 #define FT_UNDEFINED_COMPILER
132 #endif
133 
134 
135 /*****************************************************************************
136  * Declare inline
137  *****************************************************************************/
138 
139 #if defined(__cplusplus)
140 #define FT_INLINE inline
141 #else
142 #define FT_INLINE __inline
143 #endif /* if defined(__cplusplus) */
144 
145 
146 /*****************************************************************************
147  * C++ needs to know that types and declarations are C, not C++.
148  *****************************************************************************/
149 
150 #ifdef __cplusplus
151 # define FT_BEGIN_DECLS extern "C" {
152 # define FT_END_DECLS }
153 #else
154 # define FT_BEGIN_DECLS
155 # define FT_END_DECLS
156 #endif
157 
158 
159 /*****************************************************************************
160  * Helper macros
161  *****************************************************************************/
162 
163 #define FT_STR_2_CAT_(arg1, arg2) \
164  arg1##arg2
165 #define FT_STR_2_CAT(arg1, arg2) \
166  FT_STR_2_CAT_(arg1, arg2)
167 
171 static FT_INLINE int ft_check_if_string_helper(const char *str)
172 {
173  (void)str;
174  return 0;
175 }
176 
180 static FT_INLINE int ft_check_if_wstring_helper(const wchar_t *str)
181 {
182  (void)str;
183  return 0;
184 }
185 
186 #define FT_NARGS_IMPL_(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,N,...) N
187 #define FT_EXPAND_(x) x
188 #define FT_PP_NARG_(...) \
189  FT_EXPAND_(FT_NARGS_IMPL_(__VA_ARGS__,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0))
190 
191 #define FT_CHECK_IF_STR_32(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_31(checker,__VA_ARGS__)))
192 #define FT_CHECK_IF_STR_31(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_30(checker,__VA_ARGS__)))
193 #define FT_CHECK_IF_STR_30(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_29(checker,__VA_ARGS__)))
194 #define FT_CHECK_IF_STR_29(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_28(checker,__VA_ARGS__)))
195 #define FT_CHECK_IF_STR_28(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_27(checker,__VA_ARGS__)))
196 #define FT_CHECK_IF_STR_27(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_26(checker,__VA_ARGS__)))
197 #define FT_CHECK_IF_STR_26(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_25(checker,__VA_ARGS__)))
198 #define FT_CHECK_IF_STR_25(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_24(checker,__VA_ARGS__)))
199 #define FT_CHECK_IF_STR_24(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_23(checker,__VA_ARGS__)))
200 #define FT_CHECK_IF_STR_23(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_22(checker,__VA_ARGS__)))
201 #define FT_CHECK_IF_STR_22(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_21(checker,__VA_ARGS__)))
202 #define FT_CHECK_IF_STR_21(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_20(checker,__VA_ARGS__)))
203 #define FT_CHECK_IF_STR_20(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_19(checker,__VA_ARGS__)))
204 #define FT_CHECK_IF_STR_19(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_18(checker,__VA_ARGS__)))
205 #define FT_CHECK_IF_STR_18(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_17(checker,__VA_ARGS__)))
206 #define FT_CHECK_IF_STR_17(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_16(checker,__VA_ARGS__)))
207 #define FT_CHECK_IF_STR_16(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_15(checker,__VA_ARGS__)))
208 #define FT_CHECK_IF_STR_15(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_14(checker,__VA_ARGS__)))
209 #define FT_CHECK_IF_STR_14(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_13(checker,__VA_ARGS__)))
210 #define FT_CHECK_IF_STR_13(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_12(checker,__VA_ARGS__)))
211 #define FT_CHECK_IF_STR_12(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_11(checker,__VA_ARGS__)))
212 #define FT_CHECK_IF_STR_11(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_10(checker,__VA_ARGS__)))
213 #define FT_CHECK_IF_STR_10(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_9(checker,__VA_ARGS__)))
214 #define FT_CHECK_IF_STR_9(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_8(checker,__VA_ARGS__)))
215 #define FT_CHECK_IF_STR_8(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_7(checker,__VA_ARGS__)))
216 #define FT_CHECK_IF_STR_7(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_6(checker,__VA_ARGS__)))
217 #define FT_CHECK_IF_STR_6(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_5(checker,__VA_ARGS__)))
218 #define FT_CHECK_IF_STR_5(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_4(checker,__VA_ARGS__)))
219 #define FT_CHECK_IF_STR_4(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_3(checker,__VA_ARGS__)))
220 #define FT_CHECK_IF_STR_3(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_2(checker,__VA_ARGS__)))
221 #define FT_CHECK_IF_STR_2(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_1(checker,__VA_ARGS__)))
222 #define FT_CHECK_IF_STR_1(checker,arg) (checker(arg))
223 
224 #define FT_CHECK_IF_ARGS_ARE_STRINGS__(checker,func, ...) \
225  FT_EXPAND_(func(checker,__VA_ARGS__))
226 #define FT_CHECK_IF_ARGS_ARE_STRINGS_(checker,basis, n, ...) \
227  FT_CHECK_IF_ARGS_ARE_STRINGS__(checker,FT_STR_2_CAT_(basis, n), __VA_ARGS__)
228 #define FT_CHECK_IF_ARGS_ARE_STRINGS(...) \
229  FT_CHECK_IF_ARGS_ARE_STRINGS_(ft_check_if_string_helper,FT_CHECK_IF_STR_,FT_PP_NARG_(__VA_ARGS__), __VA_ARGS__)
230 
231 #ifdef FT_HAVE_WCHAR
232 #define CHECK_IF_ARGS_ARE_WSTRINGS(...) \
233  FT_CHECK_IF_ARGS_ARE_STRINGS_(ft_check_if_wstring_helper,FT_CHECK_IF_STR_,FT_PP_NARG_(__VA_ARGS__), __VA_ARGS__)
234 #endif
235 
241 /*****************************************************************************
242  * Attribute format for argument checking
243  *****************************************************************************/
244 
245 #if defined(FT_CLANG_COMPILER) || defined(FT_GCC_COMPILER)
246 #define FT_PRINTF_ATTRIBUTE_FORMAT(string_index, first_to_check) \
247  __attribute__ ((format (printf, string_index, first_to_check)))
248 #else
249 #define FT_PRINTF_ATTRIBUTE_FORMAT(string_index, first_to_check)
250 #endif /* defined(FT_CLANG_COMPILER) || defined(FT_GCC_COMPILER) */
251 
252 
253 /*****************************************************************************
254  * libfort API
255  *****************************************************************************/
256 
257 FT_BEGIN_DECLS
258 
262 struct ft_table;
263 
270 typedef struct ft_table ft_table_t;
271 
279 
290 void ft_destroy_table(ft_table_t *table);
291 
302 
315 int ft_ln(ft_table_t *table);
316 
325 size_t ft_cur_row(const ft_table_t *table);
326 
335 size_t ft_cur_col(const ft_table_t *table);
336 
350 void ft_set_cur_cell(ft_table_t *table, size_t row, size_t col);
351 
361 int ft_is_empty(const ft_table_t *table);
362 
371 size_t ft_row_count(const ft_table_t *table);
372 
393 int ft_erase_range(ft_table_t *table,
394  size_t top_left_row, size_t top_left_col,
395  size_t bottom_right_row, size_t bottom_right_col);
396 
397 #if defined(FT_CLANG_COMPILER) || defined(FT_GCC_COMPILER)
398 
424 int ft_printf(ft_table_t *table, const char *fmt, ...) FT_PRINTF_ATTRIBUTE_FORMAT(2, 3);
425 
451 int ft_printf_ln(ft_table_t *table, const char *fmt, ...) FT_PRINTF_ATTRIBUTE_FORMAT(2, 3);
452 
453 #else
454 
459 int ft_printf_impl(ft_table_t *table, const char *fmt, ...) FT_PRINTF_ATTRIBUTE_FORMAT(2, 3);
460 int ft_printf_ln_impl(ft_table_t *table, const char *fmt, ...) FT_PRINTF_ATTRIBUTE_FORMAT(2, 3);
461 
462 #define ft_printf(table, ...) \
463  (( 0 ? fprintf(stderr, __VA_ARGS__) : 1), ft_printf_impl(table, __VA_ARGS__))
464 #define ft_printf_ln(table, ...) \
465  (( 0 ? fprintf(stderr, __VA_ARGS__) : 1), ft_printf_ln_impl(table, __VA_ARGS__))
466 
470 #endif
471 
479 void ft_set_default_printf_field_separator(char separator);
480 
481 
496 #define ft_write(table, ...)\
497  (0 ? FT_CHECK_IF_ARGS_ARE_STRINGS(__VA_ARGS__) : ft_nwrite(table, FT_PP_NARG_(__VA_ARGS__), __VA_ARGS__))
498 
514 #define ft_write_ln(table, ...)\
515  (0 ? FT_CHECK_IF_ARGS_ARE_STRINGS(__VA_ARGS__) : ft_nwrite_ln(table, FT_PP_NARG_(__VA_ARGS__), __VA_ARGS__))
516 
540 int ft_nwrite(ft_table_t *table, size_t count, const char *cell_content, ...);
541 
566 int ft_nwrite_ln(ft_table_t *table, size_t count, const char *cell_content, ...);
567 
568 
569 
586 int ft_row_write(ft_table_t *table, size_t cols, const char *row_cells[]);
587 
605 int ft_row_write_ln(ft_table_t *table, size_t cols, const char *row_cells[]);
606 
607 
625 int ft_table_write(ft_table_t *table, size_t rows, size_t cols, const char *table_cells[]);
626 
645 int ft_table_write_ln(ft_table_t *table, size_t rows, size_t cols, const char *table_cells[]);
646 
647 
657 int ft_add_separator(ft_table_t *table);
658 
659 
677 const char *ft_to_string(const ft_table_t *table);
678 
679 
680 
681 
682 
683 
684 
689  const char *top_border_ch;
690  const char *separator_ch;
691  const char *bottom_border_ch;
692  const char *side_border_ch;
693  const char *out_intersect_ch;
694  const char *in_intersect_ch;
695 };
696 
701  struct ft_border_chars border_chs;
702  struct ft_border_chars header_border_chs;
703  const char *hor_separator_char;
704 };
705 
716 extern const struct ft_border_style *const FT_BASIC_STYLE;
717 extern const struct ft_border_style *const FT_BASIC2_STYLE;
718 extern const struct ft_border_style *const FT_SIMPLE_STYLE;
719 extern const struct ft_border_style *const FT_PLAIN_STYLE;
720 extern const struct ft_border_style *const FT_DOT_STYLE;
721 extern const struct ft_border_style *const FT_EMPTY_STYLE;
722 extern const struct ft_border_style *const FT_EMPTY2_STYLE;
723 extern const struct ft_border_style *const FT_SOLID_STYLE;
724 extern const struct ft_border_style *const FT_SOLID_ROUND_STYLE;
725 extern const struct ft_border_style *const FT_NICE_STYLE;
726 extern const struct ft_border_style *const FT_DOUBLE_STYLE;
727 extern const struct ft_border_style *const FT_DOUBLE2_STYLE;
728 extern const struct ft_border_style *const FT_BOLD_STYLE;
729 extern const struct ft_border_style *const FT_BOLD2_STYLE;
730 extern const struct ft_border_style *const FT_FRAME_STYLE;
744 int ft_set_default_border_style(const struct ft_border_style *style);
745 
757 int ft_set_border_style(ft_table_t *table, const struct ft_border_style *style);
758 
759 
760 
765 #define FT_ANY_COLUMN (UINT_MAX)
766 #define FT_CUR_COLUMN (UINT_MAX - 1)
767 #define FT_ANY_ROW (UINT_MAX)
768 #define FT_CUR_ROW (UINT_MAX - 1)
771 #define FT_MAX_ROW_INDEX (UINT_MAX - 2)
772 #define FT_MAX_COL_INDEX (UINT_MAX - 2)
773 
774 
779 #define FT_CPROP_MIN_WIDTH (0x01U << 0)
780 #define FT_CPROP_TEXT_ALIGN (0x01U << 1)
781 #define FT_CPROP_TOP_PADDING (0x01U << 2)
782 #define FT_CPROP_BOTTOM_PADDING (0x01U << 3)
783 #define FT_CPROP_LEFT_PADDING (0x01U << 4)
784 #define FT_CPROP_RIGHT_PADDING (0x01U << 5)
785 #define FT_CPROP_EMPTY_STR_HEIGHT (0x01U << 6)
786 #define FT_CPROP_ROW_TYPE (0x01U << 7)
787 #define FT_CPROP_CONT_FG_COLOR (0x01U << 8)
788 #define FT_CPROP_CELL_BG_COLOR (0x01U << 9)
789 #define FT_CPROP_CONT_BG_COLOR (0x01U << 10)
790 #define FT_CPROP_CELL_TEXT_STYLE (0x01U << 11)
791 #define FT_CPROP_CONT_TEXT_STYLE (0x01U << 12)
798 enum ft_color {
816 };
817 
822  FT_TSTYLE_DEFAULT = (1U << 0),
823  FT_TSTYLE_BOLD = (1U << 1),
824  FT_TSTYLE_DIM = (1U << 2),
825  FT_TSTYLE_ITALIC = (1U << 3),
826  FT_TSTYLE_UNDERLINED = (1U << 4),
827  FT_TSTYLE_BLINK = (1U << 5),
828  FT_TSTYLE_INVERTED = (1U << 6),
829  FT_TSTYLE_HIDDEN = (1U << 7)
830 };
831 
832 
840 };
841 
848 };
849 
861 int ft_set_default_cell_prop(uint32_t property, int value);
862 
880 int ft_set_cell_prop(ft_table_t *table, size_t row, size_t col, uint32_t property, int value);
881 
882 
887 #define FT_TPROP_LEFT_MARGIN (0x01U << 0)
888 #define FT_TPROP_TOP_MARGIN (0x01U << 1)
889 #define FT_TPROP_RIGHT_MARGIN (0x01U << 2)
890 #define FT_TPROP_BOTTOM_MARGIN (0x01U << 3)
891 #define FT_TPROP_ADDING_STRATEGY (0x01U << 4)
892 
903 };
904 
905 
917 int ft_set_default_tbl_prop(uint32_t property, int value);
918 
932 int ft_set_tbl_prop(ft_table_t *table, uint32_t property, int value);
933 
934 
950 int ft_set_cell_span(ft_table_t *table, size_t row, size_t col, size_t hor_span);
951 
952 
967 void ft_set_memory_funcs(void *(*f_malloc)(size_t size), void (*f_free)(void *ptr));
968 
969 
978 const char *ft_strerror(int error_code);
979 
980 
981 
982 #ifdef FT_HAVE_WCHAR
983 
984 
985 int ft_wprintf(ft_table_t *table, const wchar_t *fmt, ...);
986 int ft_wprintf_ln(ft_table_t *table, const wchar_t *fmt, ...);
987 
988 
989 #define ft_wwrite(table, ...)\
990  (0 ? CHECK_IF_ARGS_ARE_WSTRINGS(__VA_ARGS__) : ft_nwwrite(table, FT_PP_NARG_(__VA_ARGS__), __VA_ARGS__))
991 #define ft_wwrite_ln(table, ...)\
992  (0 ? CHECK_IF_ARGS_ARE_WSTRINGS(__VA_ARGS__) : ft_nwwrite_ln(table, FT_PP_NARG_(__VA_ARGS__), __VA_ARGS__))
993 int ft_nwwrite(ft_table_t *table, size_t n, const wchar_t *cell_content, ...);
994 int ft_nwwrite_ln(ft_table_t *table, size_t n, const wchar_t *cell_content, ...);
995 
996 int ft_row_wwrite(ft_table_t *table, size_t cols, const wchar_t *row_cells[]);
997 int ft_row_wwrite_ln(ft_table_t *table, size_t cols, const wchar_t *row_cells[]);
998 
999 int ft_table_wwrite(ft_table_t *table, size_t rows, size_t cols, const wchar_t *table_cells[]);
1000 int ft_table_wwrite_ln(ft_table_t *table, size_t rows, size_t cols, const wchar_t *table_cells[]);
1001 
1002 const wchar_t *ft_to_wstring(const ft_table_t *table);
1003 #endif
1004 
1005 
1006 
1007 #ifdef FT_HAVE_UTF8
1008 #define ft_u8write(table, ...)\
1009  (ft_u8nwrite(table, FT_PP_NARG_(__VA_ARGS__), __VA_ARGS__))
1010 #define ft_u8write_ln(table, ...)\
1011  (ft_u8nwrite_ln(table, FT_PP_NARG_(__VA_ARGS__), __VA_ARGS__))
1012 int ft_u8nwrite(ft_table_t *table, size_t n, const void *cell_content, ...);
1013 int ft_u8nwrite_ln(ft_table_t *table, size_t n, const void *cell_content, ...);
1014 
1015 int ft_u8printf(ft_table_t *table, const char *fmt, ...) FT_PRINTF_ATTRIBUTE_FORMAT(2, 3);
1016 int ft_u8printf_ln(ft_table_t *table, const char *fmt, ...) FT_PRINTF_ATTRIBUTE_FORMAT(2, 3);
1017 
1018 const void *ft_to_u8string(const ft_table_t *table);
1019 
1039 void ft_set_u8strwid_func(int (*u8strwid)(const void *beg, const void *end, size_t *width));
1040 
1041 #endif /* FT_HAVE_UTF8 */
1042 
1043 
1044 FT_END_DECLS
1045 
1046 #endif /* LIBFORT_H */
Definition: fort.h:801
Definition: fort.c:2231
Definition: fort.h:847
Definition: fort.h:800
int ft_set_border_style(ft_table_t *table, const struct ft_border_style *style)
Definition: fort.c:3551
Definition: fort.h:839
Definition: fort.h:822
int ft_erase_range(ft_table_t *table, size_t top_left_row, size_t top_left_col, size_t bottom_right_row, size_t bottom_right_col)
Definition: fort.c:2832
ft_text_alignment
Definition: fort.h:836
int ft_table_write(ft_table_t *table, size_t rows, size_t cols, const char *table_cells[])
Definition: fort.c:3249
ft_table_t * ft_copy_table(ft_table_t *table)
Definition: fort.c:2697
int ft_set_tbl_prop(ft_table_t *table, uint32_t property, int value)
Definition: fort.c:3600
Definition: fort.h:829
size_t ft_cur_row(const ft_table_t *table)
Definition: fort.c:2801
Definition: fort.h:811
Definition: fort.h:809
Definition: fort.h:815
int ft_table_write_ln(ft_table_t *table, size_t rows, size_t cols, const char *table_cells[])
Definition: fort.c:3267
Definition: fort.h:901
Definition: fort.h:808
void ft_set_u8strwid_func(int(*u8strwid)(const void *beg, const void *end, size_t *width))
Definition: fort.c:3743
Definition: fort.h:803
int ft_set_default_border_style(const struct ft_border_style *style)
Definition: fort.c:3545
Definition: fort.h:810
void ft_set_cur_cell(ft_table_t *table, size_t row, size_t col)
Definition: fort.c:2813
ft_table_t * ft_create_table(void)
Definition: fort.c:2639
Definition: fort.h:828
Definition: fort.h:827
Definition: fort.h:823
ft_text_style
Definition: fort.h:821
void ft_destroy_table(ft_table_t *table)
Definition: fort.c:2671
Definition: fort.h:826
Definition: fort.h:700
int ft_add_separator(ft_table_t *table)
Definition: fort.c:3418
Definition: fort.h:825
Definition: fort.h:812
Definition: fort.h:902
Definition: fort.h:688
int int void ft_set_default_printf_field_separator(char separator)
Definition: fort.c:3027
Definition: fort.h:804
int ft_set_cell_span(ft_table_t *table, size_t row, size_t col, size_t hor_span)
Definition: fort.c:3636
const char * ft_strerror(int error_code)
Definition: fort.c:3617
Definition: fort.h:813
Definition: fort.h:807
Definition: fort.h:824
int ft_printf(ft_table_t *table, const char *fmt,...) __attribute__((format(printf
int ft_set_default_cell_prop(uint32_t property, int value)
Definition: fort.c:3589
int ft_nwrite_ln(ft_table_t *table, size_t count, const char *cell_content,...)
Definition: fort.c:3115
Definition: fort.h:837
Definition: fort.h:799
int ft_row_write_ln(ft_table_t *table, size_t cols, const char *row_cells[])
Definition: fort.c:3209
Definition: fort.h:806
int ft_set_cell_prop(ft_table_t *table, size_t row, size_t col, uint32_t property, int value)
Definition: fort.c:3565
size_t ft_cur_col(const ft_table_t *table)
Definition: fort.c:2807
Definition: fort.h:814
void ft_set_memory_funcs(void *(*f_malloc)(size_t size), void(*f_free)(void *ptr))
Definition: fort.c:3612
int ft_nwrite(ft_table_t *table, size_t count, const char *cell_content,...)
Definition: fort.c:3092
Definition: fort.h:802
int ft_ln(ft_table_t *table)
Definition: fort.c:2771
Definition: fort.h:805
Definition: fort.h:838
const char * ft_to_string(const ft_table_t *table)
Definition: fort.c:3405
int ft_row_write(ft_table_t *table, size_t cols, const char *row_cells[])
Definition: fort.c:3195
Definition: fort.h:846
int int ft_printf_ln(ft_table_t *table, const char *fmt,...) __attribute__((format(printf
ft_adding_strategy
Definition: fort.h:900
ft_row_type
Definition: fort.h:845
int ft_is_empty(const ft_table_t *table)
Definition: fort.c:2820
int ft_set_default_tbl_prop(uint32_t property, int value)
Definition: fort.c:3595
size_t ft_row_count(const ft_table_t *table)
Definition: fort.c:2826