File: wedln-wrappers.c

package info (click to toggle)
notion 4.0.2%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 4,676 kB
  • sloc: ansic: 47,508; sh: 2,096; makefile: 603; perl: 270
file content (275 lines) | stat: -rw-r--r-- 5,166 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
/*
 * ion/mod_query/wedln-wrappers.c
 *
 * Copyright (c) Tuomo Valkonen 1999-2007.
 *
 * See the included file LICENSE for details.
 */

#include "wedln.h"
#include "edln.h"
#include "complete.h"

/*EXTL_DOC
 * Move backward one character.
 */
EXTL_EXPORT_MEMBER
void wedln_back(WEdln *wedln)
{
    edln_back(&(wedln->edln));
}

/*EXTL_DOC
 * Move forward one character.
 */
EXTL_EXPORT_MEMBER
void wedln_forward(WEdln *wedln)
{
    edln_forward(&(wedln->edln));
}

/*EXTL_DOC
 * Transpose characters.
 */
EXTL_EXPORT_MEMBER
void wedln_transpose_chars(WEdln *wedln)
{
    edln_transpose_chars(&(wedln->edln));
}

/*EXTL_DOC
 * Transpose words.
 */
EXTL_EXPORT_MEMBER
void wedln_transpose_words(WEdln *wedln)
{
    edln_transpose_words(&(wedln->edln));
}

/*EXTL_DOC
 * Go to the beginning of line.
 */
EXTL_EXPORT_MEMBER
void wedln_bol(WEdln *wedln)
{
    edln_bol(&(wedln->edln));
}

/*EXTL_DOC
 * Go to the end of line.
 */
EXTL_EXPORT_MEMBER
void wedln_eol(WEdln *wedln)
{
    edln_eol(&(wedln->edln));
}

/*EXTL_DOC
 * Go to to end of current sequence of whitespace followed by alphanumeric
 * characters..
 */
EXTL_EXPORT_MEMBER
void wedln_skip_word(WEdln *wedln)
{
    edln_skip_word(&(wedln->edln));
}

/*EXTL_DOC
 * Go to to beginning of current sequence of alphanumeric characters
 * followed by whitespace.
 */
EXTL_EXPORT_MEMBER
void wedln_bskip_word(WEdln *wedln)
{
    edln_bskip_word(&(wedln->edln));
}

/*EXTL_DOC
 * Delete current character.
 */
EXTL_EXPORT_MEMBER
void wedln_delete(WEdln *wedln)
{
    edln_delete(&(wedln->edln));
}

/*EXTL_DOC
 * Delete previous character.
 */
EXTL_EXPORT_MEMBER
void wedln_backspace(WEdln *wedln)
{
    edln_backspace(&(wedln->edln));
}

/*EXTL_DOC
 * Delete all characters from current to end of line.
 */
EXTL_EXPORT_MEMBER
void wedln_kill_to_eol(WEdln *wedln)
{
    edln_kill_to_eol(&(wedln->edln));
}

/*EXTL_DOC
 * Delete all characters from previous to beginning of line.
 */
EXTL_EXPORT_MEMBER
void wedln_kill_to_bol(WEdln *wedln)
{
    edln_kill_to_bol(&(wedln->edln));
}

/*EXTL_DOC
 * Delete the whole line.
 */
EXTL_EXPORT_MEMBER
void wedln_kill_line(WEdln *wedln)
{
    edln_kill_line(&(wedln->edln));
}

/*EXTL_DOC
 * Starting from the current point, delete possible whitespace and
 * following alphanumeric characters until next non-alphanumeric character.
 */
EXTL_EXPORT_MEMBER
void wedln_kill_word(WEdln *wedln)
{
    edln_kill_word(&(wedln->edln));
}

/*EXTL_DOC
 * Starting from the previous characters, delete possible whitespace and
 * preceding alphanumeric characters until previous non-alphanumeric character.
 */
EXTL_EXPORT_MEMBER
void wedln_bkill_word(WEdln *wedln)
{
    edln_bkill_word(&(wedln->edln));
}

/*EXTL_DOC
 * Set \emph{mark} to current cursor position.
 */
EXTL_EXPORT_MEMBER
void wedln_set_mark(WEdln *wedln)
{
    edln_set_mark(&(wedln->edln));
}

/*EXTL_DOC
 * Clear \emph{mark}.
 */
EXTL_EXPORT_MEMBER
void wedln_clear_mark(WEdln *wedln)
{
    edln_clear_mark(&(wedln->edln));
}

/*EXTL_DOC
 * Copy text between \emph{mark} and current cursor position to clipboard
 * and then delete that sequence.
 */
EXTL_EXPORT_MEMBER
void wedln_cut(WEdln *wedln)
{
    edln_cut(&(wedln->edln));
}

/*EXTL_DOC
 * Copy text between \emph{mark} and current cursor position to clipboard.
 */
EXTL_EXPORT_MEMBER
void wedln_copy(WEdln *wedln)
{
    edln_copy(&(wedln->edln));
}

/*EXTL_DOC
 * Replace line editor contents with next entry in history if one exists.
 * If \var{match} is \code{true}, the initial part of the history entry
 * must match the current line from beginning to point.
 */
EXTL_EXPORT_MEMBER
void wedln_history_next(WEdln *wedln, bool match)
{
    edln_history_next(&(wedln->edln), match);
}

/*EXTL_DOC
 * Replace line editor contents with previous in history if one exists.
 * If \var{match} is \code{true}, the initial part of the history entry
 * must match the current line from beginning to point.
 */
EXTL_EXPORT_MEMBER
void wedln_history_prev(WEdln *wedln, bool match)
{
    edln_history_prev(&(wedln->edln), match);
}


/*EXTL_DOC
 * Input \var{str} in wedln at current editing point.
 */
EXTL_EXPORT_AS(WEdln, insstr)
void wedln_insstr_exported(WEdln *wedln, const char *str)
{
    edln_insstr(&(wedln->edln), str);
}


/*EXTL_DOC
 * Get line editor contents.
 */
EXTL_SAFE
EXTL_EXPORT_MEMBER
const char *wedln_contents(WEdln *wedln)
{
    return wedln->edln.p;
}

/*EXTL_DOC
 * Get current editing point.
 * Beginning of the edited line is point 0.
 */
EXTL_SAFE
EXTL_EXPORT_MEMBER
int wedln_point(WEdln *wedln)
{
    return wedln->edln.point;
}

/*EXTL_DOC
 * Get current mark (start of selection) for \var{wedln}.
 * Return value of -1 indicates that there is no mark, and
 * 0 is the beginning of the line.
 */
EXTL_SAFE
EXTL_EXPORT_MEMBER
int wedln_mark(WEdln *wedln)
{
    return wedln->edln.mark;
}


/*EXTL_DOC
 * Set history context for \var{wedln}.
 */
EXTL_EXPORT_MEMBER
void wedln_set_context(WEdln *wedln, const char *context)
{
    edln_set_context(&(wedln->edln), context);
}


/*EXTL_DOC
 * Get history context for \var{wedln}.
 */
EXTL_SAFE
EXTL_EXPORT_MEMBER
const char *wedln_context(WEdln *wedln)
{
    return wedln->edln.context;
}