| 24 |
|
|
| 25 |
struct editor_data_t |
struct editor_data_t |
| 26 |
{ |
{ |
|
char *p_data_lines[MAX_EDITOR_DATA_LINES]; |
|
|
long data_line_total; |
|
| 27 |
char *p_display_lines[MAX_EDITOR_DATA_LINES]; |
char *p_display_lines[MAX_EDITOR_DATA_LINES]; |
| 28 |
long display_line_lengths[MAX_EDITOR_DATA_LINES]; |
long display_line_lengths[MAX_EDITOR_DATA_LINES]; // string length of display line |
| 29 |
|
int display_line_widths[MAX_EDITOR_DATA_LINES]; // display width of display line |
| 30 |
long display_line_total; |
long display_line_total; |
| 31 |
}; |
}; |
| 32 |
typedef struct editor_data_t EDITOR_DATA; |
typedef struct editor_data_t EDITOR_DATA; |
| 40 |
}; |
}; |
| 41 |
typedef struct editor_ctx_t EDITOR_CTX; |
typedef struct editor_ctx_t EDITOR_CTX; |
| 42 |
|
|
| 43 |
|
extern int editor_memory_pool_init(void); |
| 44 |
|
extern void editor_memory_pool_cleanup(void); |
| 45 |
|
|
| 46 |
extern EDITOR_DATA *editor_data_load(const char *p_data); |
extern EDITOR_DATA *editor_data_load(const char *p_data); |
| 47 |
extern long editor_data_save(const EDITOR_DATA *p_editor_data, char *p_data, size_t buf_len); |
extern long editor_data_save(const EDITOR_DATA *p_editor_data, char *p_data, size_t buf_len); |
| 48 |
extern void editor_data_cleanup(EDITOR_DATA *p_editor_data); |
extern void editor_data_cleanup(EDITOR_DATA *p_editor_data); |
| 52 |
extern int editor_data_insert(EDITOR_DATA *p_editor_data, long *p_display_line, long *p_offset, |
extern int editor_data_insert(EDITOR_DATA *p_editor_data, long *p_display_line, long *p_offset, |
| 53 |
const char *str, int str_len, long *p_last_updated_line); |
const char *str, int str_len, long *p_last_updated_line); |
| 54 |
|
|
| 55 |
extern int editor_data_delete(EDITOR_DATA *p_editor_data, long display_line, long offset, |
extern int editor_data_delete(EDITOR_DATA *p_editor_data, long *p_display_line, long *p_offset, |
| 56 |
long *p_last_updated_line); |
long *p_last_updated_line, int del_line); |
| 57 |
|
|
| 58 |
#endif //_EDITOR_H_ |
#endif //_EDITOR_H_ |