--- lbbs/include/str_process.h 2025/06/14 02:58:11 1.9 +++ lbbs/include/str_process.h 2026/01/03 10:27:14 1.17 @@ -1,30 +1,31 @@ -/*************************************************************************** - str_process.h - description - ------------------- - Copyright : (C) 2004-2025 by Leaflet - Email : leaflet@leafok.com - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ +/* SPDX-License-Identifier: GPL-3.0-or-later */ +/* + * str_process + * - common string processing features with UTF-8 support + * + * Copyright (C) 2004-2026 Leaflet + */ #ifndef _STR_PROCESS_H_ #define _STR_PROCESS_H_ #include -#define MAX_SPLIT_FILE_LINES 65536 +enum str_process_constant_t +{ + MAX_SPLIT_FILE_LINES = 65536, +}; -extern int split_line(const char *buffer, int max_display_len, int *p_eol, int *p_display_len); +extern int UTF8_fixed_width; -extern long split_data_lines(const char *p_buf, int max_display_len, long *p_line_offsets, long line_offsets_count); +extern int str_length(const char *str, int skip_ctrl_seq); -extern int ctrl_seq_filter(char *buffer); +extern int split_line(const char *buffer, int max_display_len, int *p_eol, int *p_display_len, int skip_ctrl_seq); + +// p_line_widths may be NULL. Otherwise, the widths of each line will be store into the pointed array +extern long split_data_lines(const char *p_buf, int max_display_len, long *p_line_offsets, long line_offsets_count, + int skip_ctrl_seq, int *p_line_widths); + +extern int str_filter(char *buffer, int skip_ctrl_seq); #endif //_STR_PROCESS_H_