2 * Copyright (C) 2008 Diego Hernan Borghetti.
9 typedef struct _E_Line
{
26 typedef struct _E_Buffer
{
27 struct _E_Buffer
*next
;
32 /* buffer name a shortcut for show in the status line. */
38 /* "top-level" line. */
41 /* current "edit" line. */
44 /* cursor position in the "current line" */
47 /* real pad for big lines. */
53 /* number of lines in this buffer. */
56 /* current line number. */
61 #define BUFFER_FLUSH (1<<0)
62 #define BUFFER_CMODE (1<<1)
64 /* buffer search mode. */
65 #define BUFFER_SEARCH_FORWARD 0
66 #define BUFFER_SEARCH_BACKWARD 1
68 /* set/unset buffer flags */
69 #define BUFFER_SET(b, f) \
73 #define BUFFER_UNSET(b, f) \
77 E_Buffer
*e_buffer_new(char *file
);
78 void e_buffer_free(E_Buffer
*bf
);
80 void e_buffer_newline(E_Buffer
*bf
);
81 void e_buffer_newline_first(E_Buffer
*bf
);
82 void e_buffer_joinline(E_Buffer
*bf
);
83 void e_buffer_splitline(E_Buffer
*bf
);
84 void e_buffer_cleanline(E_Buffer
*bf
);
85 void e_buffer_insert(E_Buffer
*bf
, int c
);
86 void e_buffer_backspace(E_Buffer
*bf
);
87 void e_buffer_del(E_Buffer
*bf
);
88 void e_buffer_killline(E_Buffer
*bf
, int cut
);
90 void e_buffer_up(E_Buffer
*bf
);
91 void e_buffer_down(E_Buffer
*bf
);
92 void e_buffer_left(E_Buffer
*bf
);
93 void e_buffer_right(E_Buffer
*bf
);
95 void e_buffer_goto(E_Buffer
*bf
, int line
);
96 void e_buffer_goto_begin(E_Buffer
*bf
);
97 void e_buffer_goto_end(E_Buffer
*bf
);
98 void e_buffer_bol(E_Buffer
*bf
);
99 void e_buffer_eol(E_Buffer
*bf
);
100 void e_buffer_scroll(E_Buffer
*bf
, int nline
, int dir
);
102 void e_buffer_search(E_Buffer
*bf
, char *pattern
, int dir
);
103 int e_buffer_replace(E_Buffer
*bf
, char *pattern
, char *replace
);
105 #endif /* _ECO_BUFFER_H */