Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 610 lines (544 sloc) 10.54 kb
dd16bddb »
2006-10-27 Initial support for creating and injecting messages into the
1 /* -*- mode: c; indent-tabs-mode: t; c-basic-offset: 8 -*- */
1152d454 »
2006-10-24 Including owl.h into perlglue.xs to make it easier to add more perl g…
2 #define OWL_PERL
3 #include "owl.h"
8ee73f8d »
2002-06-30 Fixed a memory reference bug in delete and undelete commands.
4
db8b00b0 »
2006-10-27 Exposing edit window hooks to perl
5 #define SV_IS_CODEREF(sv) (SvROK((sv)) && SvTYPE(SvRV((sv))) == SVt_PVCV)
6
39e81f79 »
2009-10-02 Return unicode strings to perl.
7 typedef char utf8;
8
74fc22a9 »
2008-01-10 Document (nearly) every public function in the BarnOwl:: namespace
9 /*************************************************************
10 * NOTE
11 *************************************************************
12 * These functions, when they are intended to be user-visible,
fd8dfe73 »
2009-06-01 Load perl code from the filesystem at runtime.
13 * are documented in perl/lib/BarnOwl.pm. If you add functions
14 * to this file, add the appropriate documentation there!
74fc22a9 »
2008-01-10 Document (nearly) every public function in the BarnOwl:: namespace
15 *
16 * If the function is simple enough, we simply define its
17 * entire functionality here in XS. If, however, it needs
18 * complex argument processing or something, we define a
19 * simple version here that takes arguments in as flat a
25cccdc8 »
2008-12-11 Rename *_internal commands into BarnOwl::Internal::
20 * manner as possible, to simplify the XS code, put it in
952f1378 »
2009-08-20 perlglue.xs: Fix typo in comment.
21 * BarnOwl::Internal::, and write a perl wrapper in BarnOwl.pm
25cccdc8 »
2008-12-11 Rename *_internal commands into BarnOwl::Internal::
22 * that munges the arguments as appropriate and calls the
23 * internal version.
74fc22a9 »
2008-01-10 Document (nearly) every public function in the BarnOwl:: namespace
24 */
8ee73f8d »
2002-06-30 Fixed a memory reference bug in delete and undelete commands.
25
65fea014 »
2008-01-11 Move comment around so that perlglue.xs compiles.
26 MODULE = BarnOwl PACKAGE = BarnOwl
27
39e81f79 »
2009-10-02 Return unicode strings to perl.
28 const utf8 *
c4ba74db »
2008-08-21 Make BarnOwl::command() accept a pre-tokenized command.
29 command(cmd, ...)
e19eb97b »
2009-08-04 Add const qualifiers for char * and void *.
30 const char *cmd
8ee73f8d »
2002-06-30 Fixed a memory reference bug in delete and undelete commands.
31 PREINIT:
32 char *rv = NULL;
e19eb97b »
2009-08-04 Add const qualifiers for char * and void *.
33 const char **argv;
c4ba74db »
2008-08-21 Make BarnOwl::command() accept a pre-tokenized command.
34 int i;
8ee73f8d »
2002-06-30 Fixed a memory reference bug in delete and undelete commands.
35 CODE:
c4ba74db »
2008-08-21 Make BarnOwl::command() accept a pre-tokenized command.
36 {
37 if (items == 1) {
38 rv = owl_function_command(cmd);
39 } else {
6a711137 »
2011-03-28 Use g_strjoinv in owl_cmddict_execute_argv, don't quote correctly
40 /* Ensure this is NULL-terminated. */
41 argv = g_new0(const char *, items + 1);
c4ba74db »
2008-08-21 Make BarnOwl::command() accept a pre-tokenized command.
42 argv[0] = cmd;
43 for(i = 1; i < items; i++) {
44 argv[i] = SvPV_nolen(ST(i));
45 }
46 rv = owl_function_command_argv(argv, items);
ddbbcffa »
2009-08-27 Replace owl_free with g_free.
47 g_free(argv);
c4ba74db »
2008-08-21 Make BarnOwl::command() accept a pre-tokenized command.
48 }
49 RETVAL = rv;
50 }
8ee73f8d »
2002-06-30 Fixed a memory reference bug in delete and undelete commands.
51 OUTPUT:
52 RETVAL
53 CLEANUP:
3b8a563a »
2011-05-07 Remove NULL checks before calling g_free
54 g_free(rv);
8ee73f8d »
2002-06-30 Fixed a memory reference bug in delete and undelete commands.
55
f1e629de »
2003-07-06 New API for perl message formatting functions.
56 SV *
57 getcurmsg()
58 CODE:
19bab8e0 »
2008-12-06 Don't return a mortal from owl_perlconfig_message2hashref().
59 RETVAL = owl_perlconfig_curmessage2hashref();
60 OUTPUT:
61 RETVAL
f1e629de »
2003-07-06 New API for perl message formatting functions.
62
63 int
64 getnumcols()
65 CODE:
66 RETVAL = owl_global_get_cols(&g);
67 OUTPUT:
68 RETVAL
7f792c1a »
2007-01-22 * Added idle-time tracking in C.
69
70 time_t
71 getidletime()
72 CODE:
73 RETVAL = owl_global_get_idletime(&g);
74 OUTPUT:
75 RETVAL
f1e629de »
2003-07-06 New API for perl message formatting functions.
76
39e81f79 »
2009-10-02 Return unicode strings to perl.
77 const utf8 *
f1e629de »
2003-07-06 New API for perl message formatting functions.
78 zephyr_getrealm()
79 CODE:
8a54409e »
2003-10-10 Small fixes to keep zephyrless build working
80 RETVAL = owl_zephyr_get_realm();
f1e629de »
2003-07-06 New API for perl message formatting functions.
81 OUTPUT:
82 RETVAL
83
39e81f79 »
2009-10-02 Return unicode strings to perl.
84 const utf8 *
f1e629de »
2003-07-06 New API for perl message formatting functions.
85 zephyr_getsender()
86 CODE:
8a54409e »
2003-10-10 Small fixes to keep zephyrless build working
87 RETVAL = owl_zephyr_get_sender();
f1e629de »
2003-07-06 New API for perl message formatting functions.
88 OUTPUT:
89 RETVAL
90
e1c4636a »
2002-07-09 * Added owl::send_zwrite(command, message) to the perl glue
91 void
f1e629de »
2003-07-06 New API for perl message formatting functions.
92 zephyr_zwrite(cmd,msg)
e19eb97b »
2009-08-04 Add const qualifiers for char * and void *.
93 const char *cmd
94 const char *msg
e1c4636a »
2002-07-09 * Added owl::send_zwrite(command, message) to the perl glue
95 PREINIT:
96 int i;
97 CODE:
98 i = owl_zwrite_create_and_send_from_line(cmd, msg);
99
39e81f79 »
2009-10-02 Return unicode strings to perl.
100 const utf8 *
e1c4636a »
2002-07-09 * Added owl::send_zwrite(command, message) to the perl glue
101 ztext_stylestrip(ztext)
e19eb97b »
2009-08-04 Add const qualifiers for char * and void *.
102 const char *ztext
e1c4636a »
2002-07-09 * Added owl::send_zwrite(command, message) to the perl glue
103 PREINIT:
104 char *rv = NULL;
105 CODE:
1fd0b25b »
2002-08-17 Added the 'search' command.
106 rv = owl_function_ztext_stylestrip(ztext);
e1c4636a »
2002-07-09 * Added owl::send_zwrite(command, message) to the perl glue
107 RETVAL = rv;
108 OUTPUT:
109 RETVAL
110 CLEANUP:
3b8a563a »
2011-05-07 Remove NULL checks before calling g_free
111 g_free(rv);
e1c4636a »
2002-07-09 * Added owl::send_zwrite(command, message) to the perl glue
112
39e81f79 »
2009-10-02 Return unicode strings to perl.
113 const utf8 *
740d5f76 »
2008-08-26 Move Zephyr and AIM reply command logic into perl.
114 zephyr_smartstrip_user(in)
e19eb97b »
2009-08-04 Add const qualifiers for char * and void *.
115 const char *in
740d5f76 »
2008-08-26 Move Zephyr and AIM reply command logic into perl.
116 PREINIT:
117 char *rv = NULL;
118 CODE:
119 {
120 rv = owl_zephyr_smartstripped_user(in);
121 RETVAL = rv;
122 }
123 OUTPUT:
124 RETVAL
125 CLEANUP:
ddbbcffa »
2009-08-27 Replace owl_free with g_free.
126 g_free(rv);
740d5f76 »
2008-08-26 Move Zephyr and AIM reply command logic into perl.
127
39e81f79 »
2009-10-02 Return unicode strings to perl.
128 const utf8 *
acb13bb6 »
2008-07-09 Add BarnOwl::zephyr_getsubs(), a thin Perl wrapper around owl_zephyr_…
129 zephyr_getsubs()
130 PREINIT:
131 char *rv = NULL;
132 CODE:
133 rv = owl_zephyr_getsubs();
134 RETVAL = rv;
135 OUTPUT:
136 RETVAL
137 CLEANUP:
3b8a563a »
2011-05-07 Remove NULL checks before calling g_free
138 g_free(rv);
acb13bb6 »
2008-07-09 Add BarnOwl::zephyr_getsubs(), a thin Perl wrapper around owl_zephyr_…
139
a130fc5e »
2011-05-23 Improved ability to delete messages from perl
140 SV *
5791bf74 »
2009-10-06 Left-align XS function names, in accordance with the decree of perlxs…
141 queue_message(msg)
dd16bddb »
2006-10-27 Initial support for creating and injecting messages into the
142 SV *msg
143 PREINIT:
144 owl_message *m;
145 CODE:
1b6b2f37 »
2006-10-27 Refactoring the editwin code somewhat, and adding the ability to hang
146 {
dd16bddb »
2006-10-27 Initial support for creating and injecting messages into the
147 if(!SvROK(msg) || SvTYPE(SvRV(msg)) != SVt_PVHV) {
3066d239 »
2007-03-22 Fix outgoing jabber logging.
148 croak("Usage: BarnOwl::queue_message($message)");
dd16bddb »
2006-10-27 Initial support for creating and injecting messages into the
149 }
17eed9c4 »
2006-12-23 Letting owl::queue_message set more fields of the message
150
30678ae9 »
2007-01-29 Making message type into a string
151 m = owl_perlconfig_hashref2message(msg);
dd16bddb »
2006-10-27 Initial support for creating and injecting messages into the
152
153 owl_global_messagequeue_addmsg(&g, m);
a130fc5e »
2011-05-23 Improved ability to delete messages from perl
154
155 RETVAL = owl_perlconfig_message2hashref(m);
1b6b2f37 »
2006-10-27 Refactoring the editwin code somewhat, and adding the ability to hang
156 }
a130fc5e »
2011-05-23 Improved ability to delete messages from perl
157 OUTPUT:
158 RETVAL
db8b00b0 »
2006-10-27 Exposing edit window hooks to perl
159
5791bf74 »
2009-10-06 Left-align XS function names, in accordance with the decree of perlxs…
160 void
161 admin_message(header, body)
e19eb97b »
2009-08-04 Add const qualifiers for char * and void *.
162 const char *header
163 const char *body
1c2e0b38 »
2007-02-11 Export owl_function_add_message and owl_function_queue_message to perl.
164 CODE:
165 {
166 owl_function_adminmsg(header, body);
167 }
168
6b3f7976 »
2006-10-31 Add get_data_dir
169
e19eb97b »
2009-08-04 Add const qualifiers for char * and void *.
170 const char *
6b3f7976 »
2006-10-31 Add get_data_dir
171 get_data_dir ()
172 CODE:
ba6c8bdc »
2009-07-23 Get rid of a few more useless casts.
173 RETVAL = owl_get_datadir();
6b3f7976 »
2006-10-31 Add get_data_dir
174 OUTPUT:
175 RETVAL
b6a253c6 »
2006-11-04 jabber.pl:
176
e19eb97b »
2009-08-04 Add const qualifiers for char * and void *.
177 const char *
b363d83e »
2007-07-08 Adding a -s switch to change the location of the config dir (~/.owl)
178 get_config_dir ()
179 CODE:
ba6c8bdc »
2009-07-23 Get rid of a few more useless casts.
180 RETVAL = owl_global_get_confdir(&g);
b363d83e »
2007-07-08 Adding a -s switch to change the location of the config dir (~/.owl)
181 OUTPUT:
182 RETVAL
183
b6a253c6 »
2006-11-04 jabber.pl:
184 void
185 popless_text(text)
e19eb97b »
2009-08-04 Add const qualifiers for char * and void *.
186 const char *text
b6a253c6 »
2006-11-04 jabber.pl:
187 CODE:
188 {
189 owl_function_popless_text(text);
190 }
191
192 void
193 popless_ztext(text)
e19eb97b »
2009-08-04 Add const qualifiers for char * and void *.
194 const char *text
b6a253c6 »
2006-11-04 jabber.pl:
195 CODE:
196 {
197 owl_fmtext fm;
198 owl_fmtext_init_null(&fm);
199 owl_fmtext_append_ztext(&fm, text);
200 owl_function_popless_fmtext(&fm);
7ab00205 »
2010-02-27 Rename owl_fmtext_free to owl_fmtext_cleanup.
201 owl_fmtext_cleanup(&fm);
b6a253c6 »
2006-11-04 jabber.pl:
202 }
0ff25289 »
2007-02-15 Explicitly declare BarnOwl::error so it won't get autoloaded and
203
204 void
205 error(text)
e19eb97b »
2009-08-04 Add const qualifiers for char * and void *.
206 const char *text
0ff25289 »
2007-02-15 Explicitly declare BarnOwl::error so it won't get autoloaded and
207 CODE:
208 {
209 owl_function_error("%s", text);
210 }
b6c067af »
2007-02-15 Moving the default style into perl, and reorganizing things so we can
211
212 void
eede1bf4 »
2009-07-27 Export owl_function_debugmsg to perl as BarnOwl::debug().
213 debug(text)
e19eb97b »
2009-08-04 Add const qualifiers for char * and void *.
214 const char *text
eede1bf4 »
2009-07-27 Export owl_function_debugmsg to perl as BarnOwl::debug().
215 CODE:
216 {
217 owl_function_debugmsg("%s", text);
218 }
219
220 void
747d6a55 »
2009-07-29 Implement BarnOwl::message in XS to fix stupid quoting issues.
221 message(text)
e19eb97b »
2009-08-04 Add const qualifiers for char * and void *.
222 const char *text
747d6a55 »
2009-07-29 Implement BarnOwl::message in XS to fix stupid quoting issues.
223 CODE:
224 {
225 owl_function_makemsg("%s", text);
226 }
227
228 void
b67ab6b9 »
2008-04-29 Implement back-compat with old-style owl::format_msg() styles
229 create_style(name, object)
e19eb97b »
2009-08-04 Add const qualifiers for char * and void *.
230 const char *name
864ed359 »
2008-04-29 Initial step of moving styles from the current mishmash of different
231 SV *object
b6c067af »
2007-02-15 Moving the default style into perl, and reorganizing things so we can
232 PREINIT:
233 owl_style *s;
234 CODE:
235 {
96828e41 »
2009-08-27 Replace owl_malloc with g_new and g_new0.
236 s = g_new(owl_style, 1);
fde6d803 »
2010-01-23 owl_style_create_perl: Change refcounting convention.
237 owl_style_create_perl(s, name, newSVsv(object));
b6c067af »
2007-02-15 Moving the default style into perl, and reorganizing things so we can
238 owl_global_add_style(&g, s);
239 }
c2c5c777 »
2007-03-29 Adding 256-color support. This requires a version of ncurses that
240
241 int
242 getnumcolors()
243 CODE:
244 RETVAL = owl_function_get_color_count();
245 OUTPUT:
246 RETVAL
247
248 void
249 _remove_filter(filterName)
e19eb97b »
2009-08-04 Add const qualifiers for char * and void *.
250 const char *filterName
c2c5c777 »
2007-03-29 Adding 256-color support. This requires a version of ncurses that
251 CODE:
252 {
253 /* Don't delete the current view, or the 'all' filter */
254 if (strcmp(filterName, owl_view_get_filtname(owl_global_get_current_view(&g)))
255 && strcmp(filterName, "all")) {
256 owl_global_remove_filter(&g,filterName);
257 }
258 }
f6b319cc »
2007-04-29 Implement hackish support for the wordwrap filter in the perl styles.
259
39e81f79 »
2009-10-02 Return unicode strings to perl.
260 const utf8 *
f6b319cc »
2007-04-29 Implement hackish support for the wordwrap filter in the perl styles.
261 wordwrap(in, cols)
e19eb97b »
2009-08-04 Add const qualifiers for char * and void *.
262 const char *in
f6b319cc »
2007-04-29 Implement hackish support for the wordwrap filter in the perl styles.
263 int cols
264 PREINIT:
265 char *rv = NULL;
266 CODE:
a695a687 »
2007-05-18 Adding the ability to define new variables from perl.
267 rv = owl_text_wordwrap(in, cols);
f6b319cc »
2007-04-29 Implement hackish support for the wordwrap filter in the perl styles.
268 RETVAL = rv;
269 OUTPUT:
270 RETVAL
271 CLEANUP:
3b8a563a »
2011-05-07 Remove NULL checks before calling g_free
272 g_free(rv);
a695a687 »
2007-05-18 Adding the ability to define new variables from perl.
273
d77e9095 »
2009-07-28 Add BarnOwl::all_filters() to get the names of all filters.
274 AV*
275 all_filters()
276 PREINIT:
ce68f235 »
2011-06-11 Make owl_dict_get_keys return a GPtrArray
277 GPtrArray *fl;
d77e9095 »
2009-07-28 Add BarnOwl::all_filters() to get the names of all filters.
278 CODE:
279 {
ce68f235 »
2011-06-11 Make owl_dict_get_keys return a GPtrArray
280 fl = owl_dict_get_keys(&g.filters);
281 RETVAL = owl_new_av(fl, (SV*(*)(const void*))owl_new_sv);
d77e9095 »
2009-07-28 Add BarnOwl::all_filters() to get the names of all filters.
282 sv_2mortal((SV*)RETVAL);
ce68f235 »
2011-06-11 Make owl_dict_get_keys return a GPtrArray
283 owl_ptr_array_free(fl, g_free);
d77e9095 »
2009-07-28 Add BarnOwl::all_filters() to get the names of all filters.
284 }
285 OUTPUT:
286 RETVAL
287
3ff3d860 »
2009-08-05 Complete variables and style names
288 AV*
289 all_styles()
290 PREINIT:
ce68f235 »
2011-06-11 Make owl_dict_get_keys return a GPtrArray
291 GPtrArray *l;
3ff3d860 »
2009-08-05 Complete variables and style names
292 CODE:
293 {
ce68f235 »
2011-06-11 Make owl_dict_get_keys return a GPtrArray
294 l = owl_global_get_style_names(&g);
295 RETVAL = owl_new_av(l, (SV*(*)(const void*))owl_new_sv);
3ff3d860 »
2009-08-05 Complete variables and style names
296 sv_2mortal((SV*)RETVAL);
297 }
298 OUTPUT:
299 RETVAL
300 CLEANUP:
ce68f235 »
2011-06-11 Make owl_dict_get_keys return a GPtrArray
301 owl_ptr_array_free(l, g_free);
3ff3d860 »
2009-08-05 Complete variables and style names
302
303
304 AV*
305 all_variables()
306 PREINIT:
ce68f235 »
2011-06-11 Make owl_dict_get_keys return a GPtrArray
307 GPtrArray *l;
3ff3d860 »
2009-08-05 Complete variables and style names
308 CODE:
309 {
ce68f235 »
2011-06-11 Make owl_dict_get_keys return a GPtrArray
310 l = owl_dict_get_keys(owl_global_get_vardict(&g));
311 RETVAL = owl_new_av(l, (SV*(*)(const void*))owl_new_sv);
fe7616e5 »
2009-10-05 Export BarnOwl::all_keymaps to perl
312 sv_2mortal((SV*)RETVAL);
313 }
314 OUTPUT:
315 RETVAL
316 CLEANUP:
ce68f235 »
2011-06-11 Make owl_dict_get_keys return a GPtrArray
317 owl_ptr_array_free(l, g_free);
fe7616e5 »
2009-10-05 Export BarnOwl::all_keymaps to perl
318
319
320 AV*
321 all_keymaps()
322 PREINIT:
ce68f235 »
2011-06-11 Make owl_dict_get_keys return a GPtrArray
323 GPtrArray *l;
fe7616e5 »
2009-10-05 Export BarnOwl::all_keymaps to perl
324 const owl_keyhandler *kh;
325 CODE:
326 {
327 kh = owl_global_get_keyhandler(&g);
ce68f235 »
2011-06-11 Make owl_dict_get_keys return a GPtrArray
328 l = owl_keyhandler_get_keymap_names(kh);
329 RETVAL = owl_new_av(l, (SV*(*)(const void*))owl_new_sv);
3ff3d860 »
2009-08-05 Complete variables and style names
330 sv_2mortal((SV*)RETVAL);
331 }
332 OUTPUT:
333 RETVAL
334 CLEANUP:
ce68f235 »
2011-06-11 Make owl_dict_get_keys return a GPtrArray
335 owl_ptr_array_free(l, g_free);
3ff3d860 »
2009-08-05 Complete variables and style names
336
4df918b4 »
2009-09-03 Add BarnOwl::redisplay()
337 void
338 redisplay()
339 CODE:
340 {
341 owl_messagelist_invalidate_formats(owl_global_get_msglist(&g));
342 owl_function_calculate_topmsg(OWL_DIRECTION_DOWNWARDS);
343 owl_mainwin_redisplay(owl_global_get_mainwin(&g));
344 }
345
fbadb376 »
2009-09-28 get_zephyr_variable: Actually, the strdup isn’t needed here at all.
346 const char *
bb79a52e »
2009-09-25 BarnOwl::get_zephyr_variable gets you a .zephyr.vars variable
347 get_zephyr_variable(name)
9cb03bf4 »
2009-09-28 get_zephyr_variable: Clean up const and NULL handling.
348 const char *name;
bb79a52e »
2009-09-25 BarnOwl::get_zephyr_variable gets you a .zephyr.vars variable
349 CODE:
fbadb376 »
2009-09-28 get_zephyr_variable: Actually, the strdup isn’t needed here at all.
350 RETVAL = owl_zephyr_get_variable(name);
bb79a52e »
2009-09-25 BarnOwl::get_zephyr_variable gets you a .zephyr.vars variable
351 OUTPUT:
352 RETVAL
353
39e81f79 »
2009-10-02 Return unicode strings to perl.
354 const utf8 *
9e5b5fde »
2009-09-09 Export skiptokens to perl.
355 skiptokens(str, n)
356 const char *str;
357 int n;
358 CODE:
359 RETVAL = skiptokens(str, n);
360 OUTPUT:
361 RETVAL
362
363
6f0fbe95 »
2009-10-03 Add a function for perl to query whether Zephyr is available.
364 MODULE = BarnOwl PACKAGE = BarnOwl::Zephyr
365
366 int
367 have_zephyr()
368 CODE:
369 RETVAL = owl_global_is_havezephyr(&g);
370 OUTPUT:
371 RETVAL
9e5b5fde »
2009-09-09 Export skiptokens to perl.
372
25cccdc8 »
2008-12-11 Rename *_internal commands into BarnOwl::Internal::
373 MODULE = BarnOwl PACKAGE = BarnOwl::Internal
374
375
376 void
377 new_command(name, func, summary, usage, description)
378 char *name
379 SV *func
380 char *summary
381 char *usage
382 char *description
383 PREINIT:
384 owl_cmd cmd;
385 CODE:
386 {
387 if(!SV_IS_CODEREF(func)) {
388 croak("Command function must be a coderef!");
389 }
390 cmd.name = name;
2fec14b2 »
2010-01-19 perlglue.xs: Copy passed-in SV*s before storing them.
391 cmd.cmd_perl = newSVsv(func);
25cccdc8 »
2008-12-11 Rename *_internal commands into BarnOwl::Internal::
392 cmd.summary = summary;
393 cmd.usage = usage;
394 cmd.description = description;
395 cmd.validctx = OWL_CTX_ANY;
396 cmd.cmd_aliased_to = NULL;
397 cmd.cmd_args_fn = NULL;
398 cmd.cmd_v_fn = NULL;
399 cmd.cmd_i_fn = NULL;
400 cmd.cmd_ctxargs_fn = NULL;
401 cmd.cmd_ctxv_fn = NULL;
402 cmd.cmd_ctxi_fn = NULL;
403 owl_cmddict_add_cmd(owl_global_get_cmddict(&g), &cmd);
404 }
405
406 void
407 new_variable_string(name, ival, summ, desc)
e19eb97b »
2009-08-04 Add const qualifiers for char * and void *.
408 const char * name
409 const char * ival
410 const char * summ
411 const char * desc
a695a687 »
2007-05-18 Adding the ability to define new variables from perl.
412 CODE:
413 owl_variable_dict_newvar_string(owl_global_get_vardict(&g),
414 name,
415 summ,
416 desc,
417 ival);
418
419 void
25cccdc8 »
2008-12-11 Rename *_internal commands into BarnOwl::Internal::
420 new_variable_int(name, ival, summ, desc)
e19eb97b »
2009-08-04 Add const qualifiers for char * and void *.
421 const char * name
a695a687 »
2007-05-18 Adding the ability to define new variables from perl.
422 int ival
e19eb97b »
2009-08-04 Add const qualifiers for char * and void *.
423 const char * summ
424 const char * desc
a695a687 »
2007-05-18 Adding the ability to define new variables from perl.
425 CODE:
426 owl_variable_dict_newvar_int(owl_global_get_vardict(&g),
427 name,
428 summ,
429 desc,
430 ival);
431
432 void
25cccdc8 »
2008-12-11 Rename *_internal commands into BarnOwl::Internal::
433 new_variable_bool(name, ival, summ, desc)
e19eb97b »
2009-08-04 Add const qualifiers for char * and void *.
434 const char * name
a695a687 »
2007-05-18 Adding the ability to define new variables from perl.
435 int ival
e19eb97b »
2009-08-04 Add const qualifiers for char * and void *.
436 const char * summ
437 const char * desc
a695a687 »
2007-05-18 Adding the ability to define new variables from perl.
438 CODE:
439 owl_variable_dict_newvar_bool(owl_global_get_vardict(&g),
440 name,
441 summ,
442 desc,
443 ival);
16318254 »
2008-12-17 Implement a perl timer class and minimal interface.
444
e89ec481 »
2011-07-10 Made BarnOwl::start_* wrappers around a new BarnOwl::start_edit
445 void
446 start_edit(edit_type, line, callback)
447 const char *edit_type
448 const char *line
449 SV *callback
450 PREINIT:
451 owl_editwin *e;
452 CODE:
453 {
454 if (!SV_IS_CODEREF(callback))
455 croak("Callback must be a subref");
456
457 if (!strcmp(edit_type, "question"))
458 e = owl_function_start_question(line);
459 else if (!strcmp(edit_type, "password"))
460 e = owl_function_start_password(line);
461 else if (!strcmp(edit_type, "edit_win"))
462 e = owl_function_start_edit_win(line);
463 else
464 croak("edit_type must be one of 'password', 'question', 'edit_win', not '%s'", edit_type);
465
466 owl_editwin_set_cbdata(e, newSVsv(callback), owl_perlconfig_dec_refcnt);
467 owl_editwin_set_callback(e, owl_perlconfig_edit_callback);
468 }
469
0190c4dd »
2009-06-20 perlglue.xs: Move editor functions into BarnOwl::Editwin::
470 MODULE = BarnOwl PACKAGE = BarnOwl::Editwin
471
77f605d7 »
2009-06-15 Slightly more rope that you require for completion.
472 int
473 replace(count, string)
474 int count;
e19eb97b »
2009-08-04 Add const qualifiers for char * and void *.
475 const char *string;
38cc669c »
2010-03-13 Create/destroy editwins rather than reusing a single one.
476 PREINIT:
477 owl_editwin *e;
77f605d7 »
2009-06-15 Slightly more rope that you require for completion.
478 CODE:
818f19c6 »
2010-08-07 Rename owl_global_get_typwin to owl_global_current_typwin
479 e = owl_global_current_typwin(&g);
38cc669c »
2010-03-13 Create/destroy editwins rather than reusing a single one.
480 if (e) {
481 RETVAL = owl_editwin_replace(e, count, string);
482 } else {
483 RETVAL = 0;
484 }
77f605d7 »
2009-06-15 Slightly more rope that you require for completion.
485 OUTPUT:
486 RETVAL
487
488 int
489 point_move(delta)
490 int delta;
38cc669c »
2010-03-13 Create/destroy editwins rather than reusing a single one.
491 PREINIT:
492 owl_editwin *e;
77f605d7 »
2009-06-15 Slightly more rope that you require for completion.
493 CODE:
818f19c6 »
2010-08-07 Rename owl_global_get_typwin to owl_global_current_typwin
494 e = owl_global_current_typwin(&g);
38cc669c »
2010-03-13 Create/destroy editwins rather than reusing a single one.
495 if (e) {
496 RETVAL = owl_editwin_point_move(e, delta);
497 } else {
498 RETVAL = 0;
499 }
77f605d7 »
2009-06-15 Slightly more rope that you require for completion.
500 OUTPUT:
501 RETVAL
a88f35a6 »
2009-06-20 Give perl code more rope with respect to the editwin.
502
503 int
504 replace_region(string)
e19eb97b »
2009-08-04 Add const qualifiers for char * and void *.
505 const char *string;
38cc669c »
2010-03-13 Create/destroy editwins rather than reusing a single one.
506 PREINIT:
507 owl_editwin *e;
a88f35a6 »
2009-06-20 Give perl code more rope with respect to the editwin.
508 CODE:
818f19c6 »
2010-08-07 Rename owl_global_get_typwin to owl_global_current_typwin
509 e = owl_global_current_typwin(&g);
38cc669c »
2010-03-13 Create/destroy editwins rather than reusing a single one.
510 if (e) {
511 RETVAL = owl_editwin_replace_region(e, string);
512 } else {
513 RETVAL = 0;
514 }
a88f35a6 »
2009-06-20 Give perl code more rope with respect to the editwin.
515 OUTPUT:
516 RETVAL
517
39e81f79 »
2009-10-02 Return unicode strings to perl.
518 const utf8 *
d41294aa »
2009-06-21 Export some more functions to perl.
519 get_region()
520 PREINIT:
521 char *region;
38cc669c »
2010-03-13 Create/destroy editwins rather than reusing a single one.
522 owl_editwin *e;
d41294aa »
2009-06-21 Export some more functions to perl.
523 CODE:
818f19c6 »
2010-08-07 Rename owl_global_get_typwin to owl_global_current_typwin
524 e = owl_global_current_typwin(&g);
38cc669c »
2010-03-13 Create/destroy editwins rather than reusing a single one.
525 if (e) {
818f19c6 »
2010-08-07 Rename owl_global_get_typwin to owl_global_current_typwin
526 region = owl_editwin_get_region(owl_global_current_typwin(&g));
38cc669c »
2010-03-13 Create/destroy editwins rather than reusing a single one.
527 } else {
528 region = NULL;
529 }
d41294aa »
2009-06-21 Export some more functions to perl.
530 RETVAL = region;
531 OUTPUT:
532 RETVAL
533 CLEANUP:
ddbbcffa »
2009-08-27 Replace owl_free with g_free.
534 g_free(region);
d41294aa »
2009-06-21 Export some more functions to perl.
535
a88f35a6 »
2009-06-20 Give perl code more rope with respect to the editwin.
536 SV *
537 save_excursion(sub)
538 SV *sub;
539 PROTOTYPE: &
540 PREINIT:
541 int count;
38cc669c »
2010-03-13 Create/destroy editwins rather than reusing a single one.
542 owl_editwin *e;
a88f35a6 »
2009-06-20 Give perl code more rope with respect to the editwin.
543 owl_editwin_excursion *x;
544 CODE:
545 {
818f19c6 »
2010-08-07 Rename owl_global_get_typwin to owl_global_current_typwin
546 e = owl_global_current_typwin(&g);
38cc669c »
2010-03-13 Create/destroy editwins rather than reusing a single one.
547 if(!e)
548 croak("The edit window is not currently active!");
549
818f19c6 »
2010-08-07 Rename owl_global_get_typwin to owl_global_current_typwin
550 x = owl_editwin_begin_excursion(owl_global_current_typwin(&g));
6dc2d6b4 »
2009-07-25 save_excursion: Fix perl API error.
551 PUSHMARK(SP);
a88f35a6 »
2009-06-20 Give perl code more rope with respect to the editwin.
552 count = call_sv(sub, G_SCALAR|G_EVAL|G_NOARGS);
6dc2d6b4 »
2009-07-25 save_excursion: Fix perl API error.
553 SPAGAIN;
818f19c6 »
2010-08-07 Rename owl_global_get_typwin to owl_global_current_typwin
554 owl_editwin_end_excursion(owl_global_current_typwin(&g), x);
a88f35a6 »
2009-06-20 Give perl code more rope with respect to the editwin.
555
556 if(SvTRUE(ERRSV)) {
557 croak(NULL);
558 }
559
560 if(count == 1)
561 RETVAL = SvREFCNT_inc(POPs);
562 else
563 XSRETURN_UNDEF;
564
565 }
566 OUTPUT:
567 RETVAL
d41294aa »
2009-06-21 Export some more functions to perl.
568
569 int
570 current_column()
38cc669c »
2010-03-13 Create/destroy editwins rather than reusing a single one.
571 PREINIT:
572 owl_editwin *e;
d41294aa »
2009-06-21 Export some more functions to perl.
573 CODE:
818f19c6 »
2010-08-07 Rename owl_global_get_typwin to owl_global_current_typwin
574 e = owl_global_current_typwin(&g);
38cc669c »
2010-03-13 Create/destroy editwins rather than reusing a single one.
575 if (e) {
576 RETVAL = owl_editwin_current_column(e);
577 } else {
578 RETVAL = 0;
579 }
d41294aa »
2009-06-21 Export some more functions to perl.
580 OUTPUT:
581 RETVAL
582
583 int
584 point()
38cc669c »
2010-03-13 Create/destroy editwins rather than reusing a single one.
585 PREINIT:
586 owl_editwin *e;
d41294aa »
2009-06-21 Export some more functions to perl.
587 CODE:
818f19c6 »
2010-08-07 Rename owl_global_get_typwin to owl_global_current_typwin
588 e = owl_global_current_typwin(&g);
38cc669c »
2010-03-13 Create/destroy editwins rather than reusing a single one.
589 if (e) {
590 RETVAL = owl_editwin_get_point(e);
591 } else {
592 RETVAL = 0;
593 }
d41294aa »
2009-06-21 Export some more functions to perl.
594 OUTPUT:
595 RETVAL
596
597 int
598 mark()
38cc669c »
2010-03-13 Create/destroy editwins rather than reusing a single one.
599 PREINIT:
600 owl_editwin *e;
d41294aa »
2009-06-21 Export some more functions to perl.
601 CODE:
818f19c6 »
2010-08-07 Rename owl_global_get_typwin to owl_global_current_typwin
602 e = owl_global_current_typwin(&g);
38cc669c »
2010-03-13 Create/destroy editwins rather than reusing a single one.
603 if (e) {
604 RETVAL = owl_editwin_get_mark(e);
605 } else {
606 RETVAL = 0;
607 }
d41294aa »
2009-06-21 Export some more functions to perl.
608 OUTPUT:
609 RETVAL
Something went wrong with that request. Please try again.