libfort
Loading...
Searching...
No Matches
fort.h
Go to the documentation of this file.
1/*
2libfort
3
4MIT License
5
6Copyright (c) 2017 - 2026 Seleznev Anton
7
8Permission is hereby granted, free of charge, to any person obtaining a copy
9of this software and associated documentation files (the "Software"), to deal
10in the Software without restriction, including without limitation the rights
11to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12copies of the Software, and to permit persons to whom the Software is
13furnished to do so, subject to the following conditions:
14
15The above copyright notice and this permission notice shall be included in all
16copies or substantial portions of the Software.
17
18THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24SOFTWARE.
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 5
49#define LIBFORT_REVISION 1
50#define LIBFORT_VERSION_STR "0.5.1"
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 * Export of symbols from shared library
137 *****************************************************************************/
138
139/*
140 * When libfort is used as a shared library (DLL) on Windows define FT_SHARED.
141 * When the shared library itself is built define FT_SHARED and
142 * FT_BUILDING_LIBRARY.
143 * CMake build of libfort defines them automatically.
144 */
145#if !defined(FT_API)
146#if (defined(_WIN32) || defined(__CYGWIN__)) && defined(FT_SHARED)
147#if defined(FT_BUILDING_LIBRARY)
148#define FT_API __declspec(dllexport)
149#else
150#define FT_API __declspec(dllimport)
151#endif
152#else
153#define FT_API
154#endif
155#endif /* !defined(FT_API) */
156
157
158/*****************************************************************************
159 * Declare inline
160 *****************************************************************************/
161
162#if defined(__cplusplus)
163#define FT_INLINE inline
164#else
165#define FT_INLINE __inline
166#endif /* if defined(__cplusplus) */
167
168
169/*****************************************************************************
170 * C++ needs to know that types and declarations are C, not C++.
171 *****************************************************************************/
172
173#ifdef __cplusplus
174# define FT_BEGIN_DECLS extern "C" {
175# define FT_END_DECLS }
176#else
177# define FT_BEGIN_DECLS
178# define FT_END_DECLS
179#endif
180
181
182/*****************************************************************************
183 * Helper macros
184 *****************************************************************************/
185
186#define FT_STR_2_CAT_(arg1, arg2) \
187 arg1##arg2
188#define FT_STR_2_CAT(arg1, arg2) \
189 FT_STR_2_CAT_(arg1, arg2)
190
194static FT_INLINE int ft_check_if_string_helper(const char *str)
195{
196 (void)str;
197 return 0;
198}
199
203static FT_INLINE int ft_check_if_wstring_helper(const wchar_t *str)
204{
205 (void)str;
206 return 0;
207}
208
209#define FT_NARGS_IMPL_(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,N,...) N
210#define FT_EXPAND_(x) x
211#define FT_PP_NARG_(...) \
212 FT_EXPAND_(FT_NARGS_IMPL_(__VA_ARGS__,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0))
213
214#define FT_CHECK_IF_STR_32(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_31(checker,__VA_ARGS__)))
215#define FT_CHECK_IF_STR_31(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_30(checker,__VA_ARGS__)))
216#define FT_CHECK_IF_STR_30(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_29(checker,__VA_ARGS__)))
217#define FT_CHECK_IF_STR_29(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_28(checker,__VA_ARGS__)))
218#define FT_CHECK_IF_STR_28(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_27(checker,__VA_ARGS__)))
219#define FT_CHECK_IF_STR_27(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_26(checker,__VA_ARGS__)))
220#define FT_CHECK_IF_STR_26(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_25(checker,__VA_ARGS__)))
221#define FT_CHECK_IF_STR_25(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_24(checker,__VA_ARGS__)))
222#define FT_CHECK_IF_STR_24(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_23(checker,__VA_ARGS__)))
223#define FT_CHECK_IF_STR_23(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_22(checker,__VA_ARGS__)))
224#define FT_CHECK_IF_STR_22(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_21(checker,__VA_ARGS__)))
225#define FT_CHECK_IF_STR_21(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_20(checker,__VA_ARGS__)))
226#define FT_CHECK_IF_STR_20(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_19(checker,__VA_ARGS__)))
227#define FT_CHECK_IF_STR_19(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_18(checker,__VA_ARGS__)))
228#define FT_CHECK_IF_STR_18(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_17(checker,__VA_ARGS__)))
229#define FT_CHECK_IF_STR_17(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_16(checker,__VA_ARGS__)))
230#define FT_CHECK_IF_STR_16(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_15(checker,__VA_ARGS__)))
231#define FT_CHECK_IF_STR_15(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_14(checker,__VA_ARGS__)))
232#define FT_CHECK_IF_STR_14(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_13(checker,__VA_ARGS__)))
233#define FT_CHECK_IF_STR_13(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_12(checker,__VA_ARGS__)))
234#define FT_CHECK_IF_STR_12(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_11(checker,__VA_ARGS__)))
235#define FT_CHECK_IF_STR_11(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_10(checker,__VA_ARGS__)))
236#define FT_CHECK_IF_STR_10(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_9(checker,__VA_ARGS__)))
237#define FT_CHECK_IF_STR_9(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_8(checker,__VA_ARGS__)))
238#define FT_CHECK_IF_STR_8(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_7(checker,__VA_ARGS__)))
239#define FT_CHECK_IF_STR_7(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_6(checker,__VA_ARGS__)))
240#define FT_CHECK_IF_STR_6(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_5(checker,__VA_ARGS__)))
241#define FT_CHECK_IF_STR_5(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_4(checker,__VA_ARGS__)))
242#define FT_CHECK_IF_STR_4(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_3(checker,__VA_ARGS__)))
243#define FT_CHECK_IF_STR_3(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_2(checker,__VA_ARGS__)))
244#define FT_CHECK_IF_STR_2(checker,arg,...) (checker(arg),FT_EXPAND_(FT_CHECK_IF_STR_1(checker,__VA_ARGS__)))
245#define FT_CHECK_IF_STR_1(checker,arg) (checker(arg))
246
247#define FT_CHECK_IF_ARGS_ARE_STRINGS__(checker,func, ...) \
248 FT_EXPAND_(func(checker,__VA_ARGS__))
249#define FT_CHECK_IF_ARGS_ARE_STRINGS_(checker,basis, n, ...) \
250 FT_CHECK_IF_ARGS_ARE_STRINGS__(checker,FT_STR_2_CAT_(basis, n), __VA_ARGS__)
251#define FT_CHECK_IF_ARGS_ARE_STRINGS(...) \
252 FT_CHECK_IF_ARGS_ARE_STRINGS_(ft_check_if_string_helper,FT_CHECK_IF_STR_,FT_PP_NARG_(__VA_ARGS__), __VA_ARGS__)
253
254#ifdef FT_HAVE_WCHAR
255#define CHECK_IF_ARGS_ARE_WSTRINGS(...) \
256 FT_CHECK_IF_ARGS_ARE_STRINGS_(ft_check_if_wstring_helper,FT_CHECK_IF_STR_,FT_PP_NARG_(__VA_ARGS__), __VA_ARGS__)
257#endif
258
264/*****************************************************************************
265 * Attribute format for argument checking
266 *****************************************************************************/
267
268#if defined(FT_CLANG_COMPILER) || defined(FT_GCC_COMPILER)
269#define FT_PRINTF_ATTRIBUTE_FORMAT(string_index, first_to_check) \
270 __attribute__ ((format (printf, string_index, first_to_check)))
271#else
272#define FT_PRINTF_ATTRIBUTE_FORMAT(string_index, first_to_check)
273#endif /* defined(FT_CLANG_COMPILER) || defined(FT_GCC_COMPILER) */
274
275
276/*****************************************************************************
277 * libfort API
278 *****************************************************************************/
279
280FT_BEGIN_DECLS
281
285struct ft_table;
286
293typedef struct ft_table ft_table_t;
294
301FT_API ft_table_t *ft_create_table(void);
302
313FT_API void ft_destroy_table(ft_table_t *table);
314
324FT_API ft_table_t *ft_copy_table(ft_table_t *table);
325
338FT_API int ft_ln(ft_table_t *table);
339
348FT_API size_t ft_cur_row(const ft_table_t *table);
349
358FT_API size_t ft_cur_col(const ft_table_t *table);
359
373FT_API void ft_set_cur_cell(ft_table_t *table, size_t row, size_t col);
374
384FT_API int ft_is_empty(const ft_table_t *table);
385
394FT_API size_t ft_row_count(const ft_table_t *table);
395
404FT_API size_t ft_col_count(const ft_table_t *table);
405
426FT_API int ft_erase_range(ft_table_t *table,
427 size_t top_left_row, size_t top_left_col,
428 size_t bottom_right_row, size_t bottom_right_col);
429
430#if defined(FT_CLANG_COMPILER) || defined(FT_GCC_COMPILER)
431
457FT_API int ft_printf(ft_table_t *table, const char *fmt, ...) FT_PRINTF_ATTRIBUTE_FORMAT(2, 3);
458
484FT_API int ft_printf_ln(ft_table_t *table, const char *fmt, ...) FT_PRINTF_ATTRIBUTE_FORMAT(2, 3);
485
486#else
487
492FT_API int ft_printf_impl(ft_table_t *table, const char *fmt, ...) FT_PRINTF_ATTRIBUTE_FORMAT(2, 3);
493FT_API int ft_printf_ln_impl(ft_table_t *table, const char *fmt, ...) FT_PRINTF_ATTRIBUTE_FORMAT(2, 3);
494
495#define ft_printf(table, ...) \
496 (( 0 ? fprintf(stderr, __VA_ARGS__) : 1), ft_printf_impl(table, __VA_ARGS__))
497#define ft_printf_ln(table, ...) \
498 (( 0 ? fprintf(stderr, __VA_ARGS__) : 1), ft_printf_ln_impl(table, __VA_ARGS__))
499
503#endif
504
512FT_API void ft_set_default_printf_field_separator(char separator);
513
514
529#define ft_write(table, ...)\
530 (0 ? FT_CHECK_IF_ARGS_ARE_STRINGS(__VA_ARGS__) : ft_nwrite(table, FT_PP_NARG_(__VA_ARGS__), __VA_ARGS__))
531
547#define ft_write_ln(table, ...)\
548 (0 ? FT_CHECK_IF_ARGS_ARE_STRINGS(__VA_ARGS__) : ft_nwrite_ln(table, FT_PP_NARG_(__VA_ARGS__), __VA_ARGS__))
549
573FT_API int ft_nwrite(ft_table_t *table, size_t count, const char *cell_content, ...);
574
599FT_API int ft_nwrite_ln(ft_table_t *table, size_t count, const char *cell_content, ...);
600
601
602
619FT_API int ft_row_write(ft_table_t *table, size_t cols, const char *row_cells[]);
620
638FT_API int ft_row_write_ln(ft_table_t *table, size_t cols, const char *row_cells[]);
639
640
658FT_API int ft_table_write(ft_table_t *table, size_t rows, size_t cols, const char *table_cells[]);
659
678FT_API int ft_table_write_ln(ft_table_t *table, size_t rows, size_t cols, const char *table_cells[]);
679
680
690FT_API int ft_add_separator(ft_table_t *table);
691
692
710FT_API const char *ft_to_string(const ft_table_t *table);
711
712
713
714
715
716
717
722 const char *top_border_ch;
723 const char *separator_ch;
724 const char *bottom_border_ch;
725 const char *side_border_ch;
726 const char *out_intersect_ch;
727 const char *in_intersect_ch;
728};
729
734 struct ft_border_chars border_chs;
735 struct ft_border_chars header_border_chs;
736 const char *hor_separator_char;
737};
738
749FT_API extern const struct ft_border_style *const FT_BASIC_STYLE;
750FT_API extern const struct ft_border_style *const FT_BASIC2_STYLE;
751FT_API extern const struct ft_border_style *const FT_SIMPLE_STYLE;
752FT_API extern const struct ft_border_style *const FT_PLAIN_STYLE;
753FT_API extern const struct ft_border_style *const FT_DOT_STYLE;
754FT_API extern const struct ft_border_style *const FT_EMPTY_STYLE;
755FT_API extern const struct ft_border_style *const FT_EMPTY2_STYLE;
756FT_API extern const struct ft_border_style *const FT_SOLID_STYLE;
757FT_API extern const struct ft_border_style *const FT_SOLID_ROUND_STYLE;
758FT_API extern const struct ft_border_style *const FT_NICE_STYLE;
759FT_API extern const struct ft_border_style *const FT_DOUBLE_STYLE;
760FT_API extern const struct ft_border_style *const FT_DOUBLE2_STYLE;
761FT_API extern const struct ft_border_style *const FT_BOLD_STYLE;
762FT_API extern const struct ft_border_style *const FT_BOLD2_STYLE;
763FT_API extern const struct ft_border_style *const FT_FRAME_STYLE;
777FT_API int ft_set_default_border_style(const struct ft_border_style *style);
778
790FT_API int ft_set_border_style(ft_table_t *table, const struct ft_border_style *style);
791
792
793
798#define FT_ANY_COLUMN (UINT_MAX)
799#define FT_CUR_COLUMN (UINT_MAX - 1)
800#define FT_ANY_ROW (UINT_MAX)
801#define FT_CUR_ROW (UINT_MAX - 1)
804#define FT_MAX_ROW_INDEX (UINT_MAX - 2)
805#define FT_MAX_COL_INDEX (UINT_MAX - 2)
806
807
812#define FT_CPROP_MIN_WIDTH (0x01U << 0)
813#define FT_CPROP_TEXT_ALIGN (0x01U << 1)
814#define FT_CPROP_TOP_PADDING (0x01U << 2)
815#define FT_CPROP_BOTTOM_PADDING (0x01U << 3)
816#define FT_CPROP_LEFT_PADDING (0x01U << 4)
817#define FT_CPROP_RIGHT_PADDING (0x01U << 5)
818#define FT_CPROP_EMPTY_STR_HEIGHT (0x01U << 6)
819#define FT_CPROP_ROW_TYPE (0x01U << 7)
820#define FT_CPROP_CONT_FG_COLOR (0x01U << 8)
821#define FT_CPROP_CELL_BG_COLOR (0x01U << 9)
822#define FT_CPROP_CONT_BG_COLOR (0x01U << 10)
823#define FT_CPROP_CELL_TEXT_STYLE (0x01U << 11)
824#define FT_CPROP_CONT_TEXT_STYLE (0x01U << 12)
850
855 FT_TSTYLE_DEFAULT = (1U << 0),
856 FT_TSTYLE_BOLD = (1U << 1),
857 FT_TSTYLE_DIM = (1U << 2),
858 FT_TSTYLE_ITALIC = (1U << 3),
860 FT_TSTYLE_BLINK = (1U << 5),
861 FT_TSTYLE_INVERTED = (1U << 6),
862 FT_TSTYLE_HIDDEN = (1U << 7)
864
865
874
882
894FT_API int ft_set_default_cell_prop(uint32_t property, int value);
895
913FT_API int ft_set_cell_prop(ft_table_t *table, size_t row, size_t col, uint32_t property, int value);
914
915
920#define FT_TPROP_LEFT_MARGIN (0x01U << 0)
921#define FT_TPROP_TOP_MARGIN (0x01U << 1)
922#define FT_TPROP_RIGHT_MARGIN (0x01U << 2)
923#define FT_TPROP_BOTTOM_MARGIN (0x01U << 3)
924#define FT_TPROP_ADDING_STRATEGY (0x01U << 4)
937
938
950FT_API int ft_set_default_tbl_prop(uint32_t property, int value);
951
965FT_API int ft_set_tbl_prop(ft_table_t *table, uint32_t property, int value);
966
967
983FT_API int ft_set_cell_span(ft_table_t *table, size_t row, size_t col, size_t hor_span);
984
985
1000FT_API void ft_set_memory_funcs(void *(*f_malloc)(size_t size), void (*f_free)(void *ptr));
1001
1002
1011FT_API const char *ft_strerror(int error_code);
1012
1013
1014
1015#ifdef FT_HAVE_WCHAR
1016
1017
1018FT_API int ft_wprintf(ft_table_t *table, const wchar_t *fmt, ...);
1019FT_API int ft_wprintf_ln(ft_table_t *table, const wchar_t *fmt, ...);
1020
1021
1022#define ft_wwrite(table, ...)\
1023 (0 ? CHECK_IF_ARGS_ARE_WSTRINGS(__VA_ARGS__) : ft_nwwrite(table, FT_PP_NARG_(__VA_ARGS__), __VA_ARGS__))
1024#define ft_wwrite_ln(table, ...)\
1025 (0 ? CHECK_IF_ARGS_ARE_WSTRINGS(__VA_ARGS__) : ft_nwwrite_ln(table, FT_PP_NARG_(__VA_ARGS__), __VA_ARGS__))
1026FT_API int ft_nwwrite(ft_table_t *table, size_t n, const wchar_t *cell_content, ...);
1027FT_API int ft_nwwrite_ln(ft_table_t *table, size_t n, const wchar_t *cell_content, ...);
1028
1029FT_API int ft_row_wwrite(ft_table_t *table, size_t cols, const wchar_t *row_cells[]);
1030FT_API int ft_row_wwrite_ln(ft_table_t *table, size_t cols, const wchar_t *row_cells[]);
1031
1032FT_API int ft_table_wwrite(ft_table_t *table, size_t rows, size_t cols, const wchar_t *table_cells[]);
1033FT_API int ft_table_wwrite_ln(ft_table_t *table, size_t rows, size_t cols, const wchar_t *table_cells[]);
1034
1035FT_API const wchar_t *ft_to_wstring(const ft_table_t *table);
1036#endif
1037
1038
1039
1040#ifdef FT_HAVE_UTF8
1041#define ft_u8write(table, ...)\
1042 (ft_u8nwrite(table, FT_PP_NARG_(__VA_ARGS__), __VA_ARGS__))
1043#define ft_u8write_ln(table, ...)\
1044 (ft_u8nwrite_ln(table, FT_PP_NARG_(__VA_ARGS__), __VA_ARGS__))
1045FT_API int ft_u8nwrite(ft_table_t *table, size_t n, const void *cell_content, ...);
1046FT_API int ft_u8nwrite_ln(ft_table_t *table, size_t n, const void *cell_content, ...);
1047
1048FT_API int ft_u8printf(ft_table_t *table, const char *fmt, ...) FT_PRINTF_ATTRIBUTE_FORMAT(2, 3);
1049FT_API int ft_u8printf_ln(ft_table_t *table, const char *fmt, ...) FT_PRINTF_ATTRIBUTE_FORMAT(2, 3);
1050
1051FT_API const void *ft_to_u8string(const ft_table_t *table);
1052
1072FT_API void ft_set_u8strwid_func(int (*u8strwid)(const void *beg, const void *end, size_t *width));
1073
1074#endif /* FT_HAVE_UTF8 */
1075
1076
1077FT_END_DECLS
1078
1079#endif /* LIBFORT_H */
int int ft_printf_ln(ft_table_t *table, const char *fmt,...) __attribute__((format(printf
ft_row_type
Definition fort.h:878
@ FT_ROW_HEADER
Definition fort.h:880
@ FT_ROW_COMMON
Definition fort.h:879
int ft_nwrite_ln(ft_table_t *table, size_t count, const char *cell_content,...)
Definition fort.c:3131
int ft_set_default_tbl_prop(uint32_t property, int value)
Definition fort.c:3611
int ft_set_cell_prop(ft_table_t *table, size_t row, size_t col, uint32_t property, int value)
Definition fort.c:3581
int ft_add_separator(ft_table_t *table)
Definition fort.c:3434
void ft_set_memory_funcs(void *(*f_malloc)(size_t size), void(*f_free)(void *ptr))
Definition fort.c:3628
int ft_ln(ft_table_t *table)
Definition fort.c:2773
ft_table_t * ft_create_table(void)
Definition fort.c:2641
ft_text_alignment
Definition fort.h:869
@ FT_ALIGNED_RIGHT
Definition fort.h:872
@ FT_ALIGNED_LEFT
Definition fort.h:870
@ FT_ALIGNED_CENTER
Definition fort.h:871
ft_table_t * ft_copy_table(ft_table_t *table)
Definition fort.c:2699
size_t ft_cur_col(const ft_table_t *table)
Definition fort.c:2809
int ft_row_write(ft_table_t *table, size_t cols, const char *row_cells[])
Definition fort.c:3211
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:2848
int ft_is_empty(const ft_table_t *table)
Definition fort.c:2822
int ft_nwrite(ft_table_t *table, size_t count, const char *cell_content,...)
Definition fort.c:3108
int ft_row_write_ln(ft_table_t *table, size_t cols, const char *row_cells[])
Definition fort.c:3225
void ft_set_cur_cell(ft_table_t *table, size_t row, size_t col)
Definition fort.c:2815
size_t ft_cur_row(const ft_table_t *table)
Definition fort.c:2803
int ft_set_default_cell_prop(uint32_t property, int value)
Definition fort.c:3605
ft_color
Definition fort.h:831
@ FT_COLOR_MAGENTA
Definition fort.h:838
@ FT_COLOR_LIGHT_GRAY
Definition fort.h:840
@ FT_COLOR_CYAN
Definition fort.h:839
@ FT_COLOR_LIGHT_GREEN
Definition fort.h:843
@ FT_COLOR_LIGHT_CYAN
Definition fort.h:847
@ FT_COLOR_DARK_GRAY
Definition fort.h:841
@ FT_COLOR_BLUE
Definition fort.h:837
@ FT_COLOR_BLACK
Definition fort.h:833
@ FT_COLOR_LIGHT_YELLOW
Definition fort.h:844
@ FT_COLOR_LIGHT_MAGENTA
Definition fort.h:846
@ FT_COLOR_GREEN
Definition fort.h:835
@ FT_COLOR_DEFAULT
Definition fort.h:832
@ FT_COLOR_LIGHT_BLUE
Definition fort.h:845
@ FT_COLOR_YELLOW
Definition fort.h:836
@ FT_COLOR_LIGHT_WHYTE
Definition fort.h:848
@ FT_COLOR_LIGHT_RED
Definition fort.h:842
@ FT_COLOR_RED
Definition fort.h:834
int ft_printf(ft_table_t *table, const char *fmt,...) __attribute__((format(printf
size_t ft_row_count(const ft_table_t *table)
Definition fort.c:2828
const char * ft_to_string(const ft_table_t *table)
Definition fort.c:3421
int ft_set_border_style(ft_table_t *table, const struct ft_border_style *style)
Definition fort.c:3567
int int void ft_set_default_printf_field_separator(char separator)
Definition fort.c:3043
const char * ft_strerror(int error_code)
Definition fort.c:3633
ft_text_style
Definition fort.h:854
@ FT_TSTYLE_HIDDEN
Definition fort.h:862
@ FT_TSTYLE_BOLD
Definition fort.h:856
@ FT_TSTYLE_ITALIC
Definition fort.h:858
@ FT_TSTYLE_BLINK
Definition fort.h:860
@ FT_TSTYLE_INVERTED
Definition fort.h:861
@ FT_TSTYLE_UNDERLINED
Definition fort.h:859
@ FT_TSTYLE_DEFAULT
Definition fort.h:855
@ FT_TSTYLE_DIM
Definition fort.h:857
int ft_table_write(ft_table_t *table, size_t rows, size_t cols, const char *table_cells[])
Definition fort.c:3265
void ft_set_u8strwid_func(int(*u8strwid)(const void *beg, const void *end, size_t *width))
Definition fort.c:3759
int ft_set_tbl_prop(ft_table_t *table, uint32_t property, int value)
Definition fort.c:3616
size_t ft_col_count(const ft_table_t *table)
Definition fort.c:2834
void ft_destroy_table(ft_table_t *table)
Definition fort.c:2673
int ft_table_write_ln(ft_table_t *table, size_t rows, size_t cols, const char *table_cells[])
Definition fort.c:3283
int ft_set_default_border_style(const struct ft_border_style *style)
Definition fort.c:3561
int ft_set_cell_span(ft_table_t *table, size_t row, size_t col, size_t hor_span)
Definition fort.c:3652
ft_adding_strategy
Definition fort.h:933
@ FT_STRATEGY_REPLACE
Definition fort.h:934
@ FT_STRATEGY_INSERT
Definition fort.h:935
Definition fort.h:721
Definition fort.h:733
Definition fort.c:2233