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

Annotation of /lbbs/include/editor.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (hide annotations)
Sat Jan 3 10:27:14 2026 UTC (2 months, 1 week ago) by sysadm
Branch: MAIN
CVS Tags: HEAD
Changes since 1.11: +1 -1 lines
Content type: text/x-chdr
Update copyright info

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

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