/[LeafOK_CVS]/lbbs/include/editor.h
ViewVC logotype

Contents of /lbbs/include/editor.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (show annotations)
Tue Nov 4 13:49:50 2025 UTC (4 months, 1 week ago) by sysadm
Branch: MAIN
Changes since 1.8: +8 -16 lines
Content type: text/x-chdr
Update file header information comments

1 /* SPDX-License-Identifier: GPL-3.0-or-later */
2 /*
3 * editor
4 * - user interactive full-screen text editor
5 *
6 * Copyright (C) 2004-2025 by Leaflet <leaflet@leafok.com>
7 */
8
9 #ifndef _EDITOR_H_
10 #define _EDITOR_H_
11
12 #include "screen.h"
13
14 #define MAX_EDITOR_DATA_LINES 65536
15 #define MAX_EDITOR_DATA_LINE_LENGTH 1024
16
17 struct editor_data_t
18 {
19 char *p_display_lines[MAX_EDITOR_DATA_LINES];
20 long display_line_lengths[MAX_EDITOR_DATA_LINES]; // string length of display line
21 int display_line_widths[MAX_EDITOR_DATA_LINES]; // display width of display line
22 long display_line_total;
23 };
24 typedef struct editor_data_t EDITOR_DATA;
25
26 struct editor_ctx_t
27 {
28 int reach_begin;
29 int reach_end;
30 long line_cursor;
31 char msg[MSG_EXT_MAX_LEN];
32 };
33 typedef struct editor_ctx_t EDITOR_CTX;
34
35 extern int editor_memory_pool_init(void);
36 extern void editor_memory_pool_cleanup(void);
37
38 extern EDITOR_DATA *editor_data_load(const char *p_data);
39 extern long editor_data_save(const EDITOR_DATA *p_editor_data, char *p_data, size_t buf_len);
40 extern void editor_data_cleanup(EDITOR_DATA *p_editor_data);
41
42 extern int editor_display(EDITOR_DATA *p_editor_data);
43
44 extern int editor_data_insert(EDITOR_DATA *p_editor_data, long *p_display_line, long *p_offset,
45 const char *str, int str_len, long *p_last_updated_line);
46
47 extern int editor_data_delete(EDITOR_DATA *p_editor_data, long *p_display_line, long *p_offset,
48 long *p_last_updated_line, int del_line);
49
50 #endif //_EDITOR_H_

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1