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

Annotation of /lbbs/include/editor.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (hide 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 sysadm 1.9 /* 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 sysadm 1.1
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 sysadm 1.7 long display_line_lengths[MAX_EDITOR_DATA_LINES]; // string length of display line
21 sysadm 1.9 int display_line_widths[MAX_EDITOR_DATA_LINES]; // display width of display line
22 sysadm 1.1 long display_line_total;
23     };
24     typedef struct editor_data_t EDITOR_DATA;
25    
26 sysadm 1.2 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 sysadm 1.5 extern int editor_memory_pool_init(void);
36     extern void editor_memory_pool_cleanup(void);
37    
38 sysadm 1.1 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 sysadm 1.3 extern int editor_data_insert(EDITOR_DATA *p_editor_data, long *p_display_line, long *p_offset,
45 sysadm 1.2 const char *str, int str_len, long *p_last_updated_line);
46    
47 sysadm 1.6 extern int editor_data_delete(EDITOR_DATA *p_editor_data, long *p_display_line, long *p_offset,
48 sysadm 1.8 long *p_last_updated_line, int del_line);
49 sysadm 1.2
50 sysadm 1.1 #endif //_EDITOR_H_

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