source:
perlglue.xs
@
b20de4f
Last change on this file since b20de4f was 8a54409, checked in by James M. Kretchmar <kretch@mit.edu>, 21 years ago | |
---|---|
|
|
File size: 1.3 KB |
Rev | Line | |
---|---|---|
[83a9b63] | 1 | static const char fileIdent[] = "$Id$"; |
2 | ||
[8a54409] | 3 | #ifdef HAVE_LIBZEPHYR |
[f1e629d] | 4 | #include <zephyr/zephyr.h> |
[8a54409] | 5 | #endif |
[f1e629d] | 6 | #include <EXTERN.h> |
7 | #include <perl.h> | |
8 | #include <XSUB.h> | |
[8ee73f8d] | 9 | |
10 | /* Yeah, we should just include owl.h, but curses and perl don't play nice. */ | |
[f1e629d] | 11 | extern char *owl_function_command(char *cmd); |
12 | extern void owl_free(void *x); | |
13 | extern SV *owl_perlconfig_curmessage2hashref(); | |
[e1c4636] | 14 | extern int owl_zwrite_create_and_send_from_line(char *, char *); |
[1fd0b25] | 15 | extern char *owl_function_ztext_stylestrip(char *); |
[f1e629d] | 16 | extern void g; |
17 | extern int owl_global_get_cols(void*); | |
[8ee73f8d] | 18 | |
19 | MODULE = owl PACKAGE = owl | |
20 | ||
21 | char * | |
22 | command(cmd) | |
23 | char *cmd | |
24 | PREINIT: | |
25 | char *rv = NULL; | |
26 | CODE: | |
27 | rv = owl_function_command(cmd); | |
28 | RETVAL = rv; | |
29 | OUTPUT: | |
30 | RETVAL | |
31 | CLEANUP: | |
32 | if (rv) owl_free(rv); | |
33 | ||
[f1e629d] | 34 | SV * |
35 | getcurmsg() | |
36 | CODE: | |
37 | ST(0) = owl_perlconfig_curmessage2hashref(); | |
38 | ||
39 | int | |
40 | getnumcols() | |
41 | CODE: | |
42 | RETVAL = owl_global_get_cols(&g); | |
43 | OUTPUT: | |
44 | RETVAL | |
45 | ||
46 | char * | |
47 | zephyr_getrealm() | |
48 | CODE: | |
[8a54409] | 49 | RETVAL = owl_zephyr_get_realm(); |
[f1e629d] | 50 | OUTPUT: |
51 | RETVAL | |
52 | ||
53 | char * | |
54 | zephyr_getsender() | |
55 | CODE: | |
[8a54409] | 56 | RETVAL = owl_zephyr_get_sender(); |
[f1e629d] | 57 | OUTPUT: |
58 | RETVAL | |
59 | ||
[e1c4636] | 60 | void |
[f1e629d] | 61 | zephyr_zwrite(cmd,msg) |
[e1c4636] | 62 | char *cmd |
63 | char *msg | |
64 | PREINIT: | |
65 | int i; | |
66 | CODE: | |
67 | i = owl_zwrite_create_and_send_from_line(cmd, msg); | |
68 | ||
69 | char * | |
70 | ztext_stylestrip(ztext) | |
71 | char *ztext | |
72 | PREINIT: | |
73 | char *rv = NULL; | |
74 | CODE: | |
[1fd0b25] | 75 | rv = owl_function_ztext_stylestrip(ztext); |
[e1c4636] | 76 | RETVAL = rv; |
77 | OUTPUT: | |
78 | RETVAL | |
79 | CLEANUP: | |
80 | if (rv) owl_free(rv); | |
81 |
Note: See TracBrowser
for help on using the repository browser.