1 | /* -*- mode: c; indent-tabs-mode: t; c-basic-offset: 8 -*- */ |
---|
2 | #ifdef HAVE_LIBZEPHYR |
---|
3 | #include <zephyr/zephyr.h> |
---|
4 | #endif |
---|
5 | #include <EXTERN.h> |
---|
6 | |
---|
7 | #define OWL_PERL |
---|
8 | #include "owl.h" |
---|
9 | |
---|
10 | #define SV_IS_CODEREF(sv) (SvROK((sv)) && SvTYPE(SvRV((sv))) == SVt_PVCV) |
---|
11 | |
---|
12 | typedef char utf8; |
---|
13 | |
---|
14 | /************************************************************* |
---|
15 | * NOTE |
---|
16 | ************************************************************* |
---|
17 | * These functions, when they are intended to be user-visible, |
---|
18 | * are documented in perl/lib/BarnOwl.pm. If you add functions |
---|
19 | * to this file, add the appropriate documentation there! |
---|
20 | * |
---|
21 | * If the function is simple enough, we simply define its |
---|
22 | * entire functionality here in XS. If, however, it needs |
---|
23 | * complex argument processing or something, we define a |
---|
24 | * simple version here that takes arguments in as flat a |
---|
25 | * manner as possible, to simplify the XS code, put it in |
---|
26 | * BarnOwl::Internal::, and write a perl wrapper in BarnOwl.pm |
---|
27 | * that munges the arguments as appropriate and calls the |
---|
28 | * internal version. |
---|
29 | */ |
---|
30 | |
---|
31 | MODULE = BarnOwl PACKAGE = BarnOwl |
---|
32 | |
---|
33 | const utf8 * |
---|
34 | command(cmd, ...) |
---|
35 | const char *cmd |
---|
36 | PREINIT: |
---|
37 | char *rv = NULL; |
---|
38 | const char **argv; |
---|
39 | int i; |
---|
40 | CODE: |
---|
41 | { |
---|
42 | if (items == 1) { |
---|
43 | rv = owl_function_command(cmd); |
---|
44 | } else { |
---|
45 | /* Ensure this is NULL-terminated. */ |
---|
46 | argv = g_new0(const char *, items + 1); |
---|
47 | argv[0] = cmd; |
---|
48 | for(i = 1; i < items; i++) { |
---|
49 | argv[i] = SvPV_nolen(ST(i)); |
---|
50 | } |
---|
51 | rv = owl_function_command_argv(argv, items); |
---|
52 | g_free(argv); |
---|
53 | } |
---|
54 | RETVAL = rv; |
---|
55 | } |
---|
56 | OUTPUT: |
---|
57 | RETVAL |
---|
58 | CLEANUP: |
---|
59 | g_free(rv); |
---|
60 | |
---|
61 | SV * |
---|
62 | getcurmsg() |
---|
63 | CODE: |
---|
64 | RETVAL = owl_perlconfig_curmessage2hashref(); |
---|
65 | OUTPUT: |
---|
66 | RETVAL |
---|
67 | |
---|
68 | int |
---|
69 | getnumcols() |
---|
70 | CODE: |
---|
71 | RETVAL = owl_global_get_cols(&g); |
---|
72 | OUTPUT: |
---|
73 | RETVAL |
---|
74 | |
---|
75 | time_t |
---|
76 | getidletime() |
---|
77 | CODE: |
---|
78 | RETVAL = owl_global_get_idletime(&g); |
---|
79 | OUTPUT: |
---|
80 | RETVAL |
---|
81 | |
---|
82 | const utf8 * |
---|
83 | zephyr_getrealm() |
---|
84 | CODE: |
---|
85 | RETVAL = owl_zephyr_get_realm(); |
---|
86 | OUTPUT: |
---|
87 | RETVAL |
---|
88 | |
---|
89 | const utf8 * |
---|
90 | zephyr_getsender() |
---|
91 | CODE: |
---|
92 | RETVAL = owl_zephyr_get_sender(); |
---|
93 | OUTPUT: |
---|
94 | RETVAL |
---|
95 | |
---|
96 | void |
---|
97 | zephyr_zwrite(cmd,msg) |
---|
98 | const char *cmd |
---|
99 | const char *msg |
---|
100 | PREINIT: |
---|
101 | int i; |
---|
102 | CODE: |
---|
103 | i = owl_zwrite_create_and_send_from_line(cmd, msg); |
---|
104 | |
---|
105 | const utf8 * |
---|
106 | ztext_stylestrip(ztext) |
---|
107 | const char *ztext |
---|
108 | PREINIT: |
---|
109 | char *rv = NULL; |
---|
110 | CODE: |
---|
111 | rv = owl_function_ztext_stylestrip(ztext); |
---|
112 | RETVAL = rv; |
---|
113 | OUTPUT: |
---|
114 | RETVAL |
---|
115 | CLEANUP: |
---|
116 | g_free(rv); |
---|
117 | |
---|
118 | const utf8 * |
---|
119 | zephyr_smartstrip_user(in) |
---|
120 | const char *in |
---|
121 | PREINIT: |
---|
122 | char *rv = NULL; |
---|
123 | CODE: |
---|
124 | { |
---|
125 | rv = owl_zephyr_smartstripped_user(in); |
---|
126 | RETVAL = rv; |
---|
127 | } |
---|
128 | OUTPUT: |
---|
129 | RETVAL |
---|
130 | CLEANUP: |
---|
131 | g_free(rv); |
---|
132 | |
---|
133 | const utf8 * |
---|
134 | zephyr_getsubs() |
---|
135 | PREINIT: |
---|
136 | char *rv = NULL; |
---|
137 | CODE: |
---|
138 | rv = owl_zephyr_getsubs(); |
---|
139 | RETVAL = rv; |
---|
140 | OUTPUT: |
---|
141 | RETVAL |
---|
142 | CLEANUP: |
---|
143 | g_free(rv); |
---|
144 | |
---|
145 | void |
---|
146 | queue_message(msg) |
---|
147 | SV *msg |
---|
148 | PREINIT: |
---|
149 | owl_message *m; |
---|
150 | CODE: |
---|
151 | { |
---|
152 | if(!SvROK(msg) || SvTYPE(SvRV(msg)) != SVt_PVHV) { |
---|
153 | croak("Usage: BarnOwl::queue_message($message)"); |
---|
154 | } |
---|
155 | |
---|
156 | m = owl_perlconfig_hashref2message(msg); |
---|
157 | |
---|
158 | owl_global_messagequeue_addmsg(&g, m); |
---|
159 | } |
---|
160 | |
---|
161 | void |
---|
162 | admin_message(header, body) |
---|
163 | const char *header |
---|
164 | const char *body |
---|
165 | CODE: |
---|
166 | { |
---|
167 | owl_function_adminmsg(header, body); |
---|
168 | } |
---|
169 | |
---|
170 | void |
---|
171 | start_question(line, callback) |
---|
172 | const char *line |
---|
173 | SV *callback |
---|
174 | PREINIT: |
---|
175 | owl_editwin *e; |
---|
176 | CODE: |
---|
177 | { |
---|
178 | if(!SV_IS_CODEREF(callback)) |
---|
179 | croak("Callback must be a subref"); |
---|
180 | |
---|
181 | e = owl_function_start_question(line); |
---|
182 | |
---|
183 | owl_editwin_set_cbdata(e, |
---|
184 | newSVsv(callback), |
---|
185 | owl_perlconfig_dec_refcnt); |
---|
186 | owl_editwin_set_callback(e, owl_perlconfig_edit_callback); |
---|
187 | } |
---|
188 | |
---|
189 | void |
---|
190 | start_password(line, callback) |
---|
191 | const char *line |
---|
192 | SV *callback |
---|
193 | PREINIT: |
---|
194 | owl_editwin *e; |
---|
195 | CODE: |
---|
196 | { |
---|
197 | if(!SV_IS_CODEREF(callback)) |
---|
198 | croak("Callback must be a subref"); |
---|
199 | |
---|
200 | e = owl_function_start_password(line); |
---|
201 | |
---|
202 | owl_editwin_set_cbdata(e, |
---|
203 | newSVsv(callback), |
---|
204 | owl_perlconfig_dec_refcnt); |
---|
205 | owl_editwin_set_callback(e, owl_perlconfig_edit_callback); |
---|
206 | } |
---|
207 | |
---|
208 | void |
---|
209 | start_edit_win(line, callback) |
---|
210 | const char *line |
---|
211 | SV *callback |
---|
212 | CODE: |
---|
213 | { |
---|
214 | if(!SV_IS_CODEREF(callback)) |
---|
215 | croak("Callback must be a subref"); |
---|
216 | |
---|
217 | owl_function_start_edit_win(line, |
---|
218 | owl_perlconfig_edit_callback, |
---|
219 | newSVsv(callback), |
---|
220 | owl_perlconfig_dec_refcnt); |
---|
221 | } |
---|
222 | |
---|
223 | |
---|
224 | const char * |
---|
225 | get_data_dir () |
---|
226 | CODE: |
---|
227 | RETVAL = owl_get_datadir(); |
---|
228 | OUTPUT: |
---|
229 | RETVAL |
---|
230 | |
---|
231 | const char * |
---|
232 | get_config_dir () |
---|
233 | CODE: |
---|
234 | RETVAL = owl_global_get_confdir(&g); |
---|
235 | OUTPUT: |
---|
236 | RETVAL |
---|
237 | |
---|
238 | void |
---|
239 | popless_text(text) |
---|
240 | const char *text |
---|
241 | CODE: |
---|
242 | { |
---|
243 | owl_function_popless_text(text); |
---|
244 | } |
---|
245 | |
---|
246 | void |
---|
247 | popless_ztext(text) |
---|
248 | const char *text |
---|
249 | CODE: |
---|
250 | { |
---|
251 | owl_fmtext fm; |
---|
252 | owl_fmtext_init_null(&fm); |
---|
253 | owl_fmtext_append_ztext(&fm, text); |
---|
254 | owl_function_popless_fmtext(&fm); |
---|
255 | owl_fmtext_cleanup(&fm); |
---|
256 | } |
---|
257 | |
---|
258 | void |
---|
259 | error(text) |
---|
260 | const char *text |
---|
261 | CODE: |
---|
262 | { |
---|
263 | owl_function_error("%s", text); |
---|
264 | } |
---|
265 | |
---|
266 | void |
---|
267 | debug(text) |
---|
268 | const char *text |
---|
269 | CODE: |
---|
270 | { |
---|
271 | owl_function_debugmsg("%s", text); |
---|
272 | } |
---|
273 | |
---|
274 | void |
---|
275 | message(text) |
---|
276 | const char *text |
---|
277 | CODE: |
---|
278 | { |
---|
279 | owl_function_makemsg("%s", text); |
---|
280 | } |
---|
281 | |
---|
282 | void |
---|
283 | create_style(name, object) |
---|
284 | const char *name |
---|
285 | SV *object |
---|
286 | PREINIT: |
---|
287 | owl_style *s; |
---|
288 | CODE: |
---|
289 | { |
---|
290 | s = g_new(owl_style, 1); |
---|
291 | owl_style_create_perl(s, name, newSVsv(object)); |
---|
292 | owl_global_add_style(&g, s); |
---|
293 | } |
---|
294 | |
---|
295 | int |
---|
296 | getnumcolors() |
---|
297 | CODE: |
---|
298 | RETVAL = owl_function_get_color_count(); |
---|
299 | OUTPUT: |
---|
300 | RETVAL |
---|
301 | |
---|
302 | void |
---|
303 | _remove_filter(filterName) |
---|
304 | const char *filterName |
---|
305 | CODE: |
---|
306 | { |
---|
307 | /* Don't delete the current view, or the 'all' filter */ |
---|
308 | if (strcmp(filterName, owl_view_get_filtname(owl_global_get_current_view(&g))) |
---|
309 | && strcmp(filterName, "all")) { |
---|
310 | owl_global_remove_filter(&g,filterName); |
---|
311 | } |
---|
312 | } |
---|
313 | |
---|
314 | const utf8 * |
---|
315 | wordwrap(in, cols) |
---|
316 | const char *in |
---|
317 | int cols |
---|
318 | PREINIT: |
---|
319 | char *rv = NULL; |
---|
320 | CODE: |
---|
321 | rv = owl_text_wordwrap(in, cols); |
---|
322 | RETVAL = rv; |
---|
323 | OUTPUT: |
---|
324 | RETVAL |
---|
325 | CLEANUP: |
---|
326 | g_free(rv); |
---|
327 | |
---|
328 | void |
---|
329 | remove_io_dispatch(fd) |
---|
330 | int fd |
---|
331 | CODE: |
---|
332 | owl_select_remove_perl_io_dispatch(fd); |
---|
333 | |
---|
334 | AV* |
---|
335 | all_filters() |
---|
336 | PREINIT: |
---|
337 | owl_list fl; |
---|
338 | CODE: |
---|
339 | { |
---|
340 | owl_list_create(&fl); |
---|
341 | owl_dict_get_keys(&g.filters, &fl); |
---|
342 | RETVAL = owl_new_av(&fl, (SV*(*)(const void*))owl_new_sv); |
---|
343 | sv_2mortal((SV*)RETVAL); |
---|
344 | owl_list_cleanup(&fl, g_free); |
---|
345 | } |
---|
346 | OUTPUT: |
---|
347 | RETVAL |
---|
348 | |
---|
349 | AV* |
---|
350 | all_styles() |
---|
351 | PREINIT: |
---|
352 | owl_list l; |
---|
353 | CODE: |
---|
354 | { |
---|
355 | owl_list_create(&l); |
---|
356 | owl_global_get_style_names(&g, &l); |
---|
357 | RETVAL = owl_new_av(&l, (SV*(*)(const void*))owl_new_sv); |
---|
358 | sv_2mortal((SV*)RETVAL); |
---|
359 | } |
---|
360 | OUTPUT: |
---|
361 | RETVAL |
---|
362 | CLEANUP: |
---|
363 | owl_list_cleanup(&l, g_free); |
---|
364 | |
---|
365 | |
---|
366 | AV* |
---|
367 | all_variables() |
---|
368 | PREINIT: |
---|
369 | owl_list l; |
---|
370 | CODE: |
---|
371 | { |
---|
372 | owl_list_create(&l); |
---|
373 | owl_dict_get_keys(owl_global_get_vardict(&g), &l); |
---|
374 | RETVAL = owl_new_av(&l, (SV*(*)(const void*))owl_new_sv); |
---|
375 | sv_2mortal((SV*)RETVAL); |
---|
376 | } |
---|
377 | OUTPUT: |
---|
378 | RETVAL |
---|
379 | CLEANUP: |
---|
380 | owl_list_cleanup(&l, g_free); |
---|
381 | |
---|
382 | |
---|
383 | AV* |
---|
384 | all_keymaps() |
---|
385 | PREINIT: |
---|
386 | owl_list l; |
---|
387 | const owl_keyhandler *kh; |
---|
388 | CODE: |
---|
389 | { |
---|
390 | kh = owl_global_get_keyhandler(&g); |
---|
391 | owl_list_create(&l); |
---|
392 | owl_keyhandler_get_keymap_names(kh, &l); |
---|
393 | RETVAL = owl_new_av(&l, (SV*(*)(const void*))owl_new_sv); |
---|
394 | sv_2mortal((SV*)RETVAL); |
---|
395 | } |
---|
396 | OUTPUT: |
---|
397 | RETVAL |
---|
398 | CLEANUP: |
---|
399 | owl_list_cleanup(&l, g_free); |
---|
400 | |
---|
401 | void |
---|
402 | redisplay() |
---|
403 | CODE: |
---|
404 | { |
---|
405 | owl_messagelist_invalidate_formats(owl_global_get_msglist(&g)); |
---|
406 | owl_function_calculate_topmsg(OWL_DIRECTION_DOWNWARDS); |
---|
407 | owl_mainwin_redisplay(owl_global_get_mainwin(&g)); |
---|
408 | } |
---|
409 | |
---|
410 | const char * |
---|
411 | get_zephyr_variable(name) |
---|
412 | const char *name; |
---|
413 | CODE: |
---|
414 | RETVAL = owl_zephyr_get_variable(name); |
---|
415 | OUTPUT: |
---|
416 | RETVAL |
---|
417 | |
---|
418 | const utf8 * |
---|
419 | skiptokens(str, n) |
---|
420 | const char *str; |
---|
421 | int n; |
---|
422 | CODE: |
---|
423 | RETVAL = skiptokens(str, n); |
---|
424 | OUTPUT: |
---|
425 | RETVAL |
---|
426 | |
---|
427 | |
---|
428 | MODULE = BarnOwl PACKAGE = BarnOwl::Zephyr |
---|
429 | |
---|
430 | int |
---|
431 | have_zephyr() |
---|
432 | CODE: |
---|
433 | RETVAL = owl_global_is_havezephyr(&g); |
---|
434 | OUTPUT: |
---|
435 | RETVAL |
---|
436 | |
---|
437 | MODULE = BarnOwl PACKAGE = BarnOwl::Internal |
---|
438 | |
---|
439 | |
---|
440 | void |
---|
441 | new_command(name, func, summary, usage, description) |
---|
442 | char *name |
---|
443 | SV *func |
---|
444 | char *summary |
---|
445 | char *usage |
---|
446 | char *description |
---|
447 | PREINIT: |
---|
448 | owl_cmd cmd; |
---|
449 | CODE: |
---|
450 | { |
---|
451 | if(!SV_IS_CODEREF(func)) { |
---|
452 | croak("Command function must be a coderef!"); |
---|
453 | } |
---|
454 | cmd.name = name; |
---|
455 | cmd.cmd_perl = newSVsv(func); |
---|
456 | cmd.summary = summary; |
---|
457 | cmd.usage = usage; |
---|
458 | cmd.description = description; |
---|
459 | cmd.validctx = OWL_CTX_ANY; |
---|
460 | cmd.cmd_aliased_to = NULL; |
---|
461 | cmd.cmd_args_fn = NULL; |
---|
462 | cmd.cmd_v_fn = NULL; |
---|
463 | cmd.cmd_i_fn = NULL; |
---|
464 | cmd.cmd_ctxargs_fn = NULL; |
---|
465 | cmd.cmd_ctxv_fn = NULL; |
---|
466 | cmd.cmd_ctxi_fn = NULL; |
---|
467 | owl_cmddict_add_cmd(owl_global_get_cmddict(&g), &cmd); |
---|
468 | } |
---|
469 | |
---|
470 | void |
---|
471 | new_variable_string(name, ival, summ, desc) |
---|
472 | const char * name |
---|
473 | const char * ival |
---|
474 | const char * summ |
---|
475 | const char * desc |
---|
476 | CODE: |
---|
477 | owl_variable_dict_newvar_string(owl_global_get_vardict(&g), |
---|
478 | name, |
---|
479 | summ, |
---|
480 | desc, |
---|
481 | ival); |
---|
482 | |
---|
483 | void |
---|
484 | new_variable_int(name, ival, summ, desc) |
---|
485 | const char * name |
---|
486 | int ival |
---|
487 | const char * summ |
---|
488 | const char * desc |
---|
489 | CODE: |
---|
490 | owl_variable_dict_newvar_int(owl_global_get_vardict(&g), |
---|
491 | name, |
---|
492 | summ, |
---|
493 | desc, |
---|
494 | ival); |
---|
495 | |
---|
496 | void |
---|
497 | new_variable_bool(name, ival, summ, desc) |
---|
498 | const char * name |
---|
499 | int ival |
---|
500 | const char * summ |
---|
501 | const char * desc |
---|
502 | CODE: |
---|
503 | owl_variable_dict_newvar_bool(owl_global_get_vardict(&g), |
---|
504 | name, |
---|
505 | summ, |
---|
506 | desc, |
---|
507 | ival); |
---|
508 | |
---|
509 | void |
---|
510 | add_io_dispatch(fd, mode, cb) |
---|
511 | int fd |
---|
512 | int mode |
---|
513 | SV * cb |
---|
514 | CODE: |
---|
515 | owl_select_add_perl_io_dispatch(fd, mode, newSVsv(cb)); |
---|
516 | |
---|
517 | MODULE = BarnOwl PACKAGE = BarnOwl::Editwin |
---|
518 | |
---|
519 | int |
---|
520 | replace(count, string) |
---|
521 | int count; |
---|
522 | const char *string; |
---|
523 | PREINIT: |
---|
524 | owl_editwin *e; |
---|
525 | CODE: |
---|
526 | e = owl_global_current_typwin(&g); |
---|
527 | if (e) { |
---|
528 | RETVAL = owl_editwin_replace(e, count, string); |
---|
529 | } else { |
---|
530 | RETVAL = 0; |
---|
531 | } |
---|
532 | OUTPUT: |
---|
533 | RETVAL |
---|
534 | |
---|
535 | int |
---|
536 | point_move(delta) |
---|
537 | int delta; |
---|
538 | PREINIT: |
---|
539 | owl_editwin *e; |
---|
540 | CODE: |
---|
541 | e = owl_global_current_typwin(&g); |
---|
542 | if (e) { |
---|
543 | RETVAL = owl_editwin_point_move(e, delta); |
---|
544 | } else { |
---|
545 | RETVAL = 0; |
---|
546 | } |
---|
547 | OUTPUT: |
---|
548 | RETVAL |
---|
549 | |
---|
550 | int |
---|
551 | replace_region(string) |
---|
552 | const char *string; |
---|
553 | PREINIT: |
---|
554 | owl_editwin *e; |
---|
555 | CODE: |
---|
556 | e = owl_global_current_typwin(&g); |
---|
557 | if (e) { |
---|
558 | RETVAL = owl_editwin_replace_region(e, string); |
---|
559 | } else { |
---|
560 | RETVAL = 0; |
---|
561 | } |
---|
562 | OUTPUT: |
---|
563 | RETVAL |
---|
564 | |
---|
565 | const utf8 * |
---|
566 | get_region() |
---|
567 | PREINIT: |
---|
568 | char *region; |
---|
569 | owl_editwin *e; |
---|
570 | CODE: |
---|
571 | e = owl_global_current_typwin(&g); |
---|
572 | if (e) { |
---|
573 | region = owl_editwin_get_region(owl_global_current_typwin(&g)); |
---|
574 | } else { |
---|
575 | region = NULL; |
---|
576 | } |
---|
577 | RETVAL = region; |
---|
578 | OUTPUT: |
---|
579 | RETVAL |
---|
580 | CLEANUP: |
---|
581 | g_free(region); |
---|
582 | |
---|
583 | SV * |
---|
584 | save_excursion(sub) |
---|
585 | SV *sub; |
---|
586 | PROTOTYPE: & |
---|
587 | PREINIT: |
---|
588 | int count; |
---|
589 | owl_editwin *e; |
---|
590 | owl_editwin_excursion *x; |
---|
591 | CODE: |
---|
592 | { |
---|
593 | e = owl_global_current_typwin(&g); |
---|
594 | if(!e) |
---|
595 | croak("The edit window is not currently active!"); |
---|
596 | |
---|
597 | x = owl_editwin_begin_excursion(owl_global_current_typwin(&g)); |
---|
598 | PUSHMARK(SP); |
---|
599 | count = call_sv(sub, G_SCALAR|G_EVAL|G_NOARGS); |
---|
600 | SPAGAIN; |
---|
601 | owl_editwin_end_excursion(owl_global_current_typwin(&g), x); |
---|
602 | |
---|
603 | if(SvTRUE(ERRSV)) { |
---|
604 | croak(NULL); |
---|
605 | } |
---|
606 | |
---|
607 | if(count == 1) |
---|
608 | RETVAL = SvREFCNT_inc(POPs); |
---|
609 | else |
---|
610 | XSRETURN_UNDEF; |
---|
611 | |
---|
612 | } |
---|
613 | OUTPUT: |
---|
614 | RETVAL |
---|
615 | |
---|
616 | int |
---|
617 | current_column() |
---|
618 | PREINIT: |
---|
619 | owl_editwin *e; |
---|
620 | CODE: |
---|
621 | e = owl_global_current_typwin(&g); |
---|
622 | if (e) { |
---|
623 | RETVAL = owl_editwin_current_column(e); |
---|
624 | } else { |
---|
625 | RETVAL = 0; |
---|
626 | } |
---|
627 | OUTPUT: |
---|
628 | RETVAL |
---|
629 | |
---|
630 | int |
---|
631 | point() |
---|
632 | PREINIT: |
---|
633 | owl_editwin *e; |
---|
634 | CODE: |
---|
635 | e = owl_global_current_typwin(&g); |
---|
636 | if (e) { |
---|
637 | RETVAL = owl_editwin_get_point(e); |
---|
638 | } else { |
---|
639 | RETVAL = 0; |
---|
640 | } |
---|
641 | OUTPUT: |
---|
642 | RETVAL |
---|
643 | |
---|
644 | int |
---|
645 | mark() |
---|
646 | PREINIT: |
---|
647 | owl_editwin *e; |
---|
648 | CODE: |
---|
649 | e = owl_global_current_typwin(&g); |
---|
650 | if (e) { |
---|
651 | RETVAL = owl_editwin_get_mark(e); |
---|
652 | } else { |
---|
653 | RETVAL = 0; |
---|
654 | } |
---|
655 | OUTPUT: |
---|
656 | RETVAL |
---|