source: perlglue.xs @ e1c4636

barnowl_perlaimdebianowlrelease-1.4release-1.5release-1.6release-1.7release-1.8release-1.9
Last change on this file since e1c4636 was e1c4636, checked in by Erik Nygren <nygren@mit.edu>, 18 years ago
* Added owl::send_zwrite(command, message) to the perl glue to allow for the direct sending of multi-line messages. For example: owl::send_zwrite("-c foo -i bar", "hello"); * Reverted attempted fix for the pagedown problem which just made things worse. * Changed owl_fmtext_print_plain to return an alloc'd string to avoid buffer overrun risks. * Added owl::ztext_stylestrip("...") function to perlglue which returns the ztext with formatting stripped out. * Added colorztext variable which can be used to disable @color() strings arriving in messages after it is set. (Currently, changing its value won't reformat messages). * Outgoing zephyr logging now obeys the logpath variable. * The '~' character in logpath and classlogpath now gets replaced with the user's home directory.
  • Property mode set to 100644
File size: 887 bytes
Line 
1static const char fileIdent[] = "$Id$";
2
3#include "EXTERN.h"
4#include "perl.h"
5#include "XSUB.h"
6
7/* Yeah, we should just include owl.h, but curses and perl don't play nice. */
8extern char *owl_function_command(char *);
9extern void owl_free(void *);
10extern int owl_zwrite_create_and_send_from_line(char *, char *);
11extern char *owl_fmtext_ztext_stylestrip(char *);
12
13MODULE = owl            PACKAGE = owl           
14
15char *
16command(cmd)
17        char *cmd
18        PREINIT:
19                char *rv = NULL;
20        CODE:
21                rv = owl_function_command(cmd);
22                RETVAL = rv;   
23        OUTPUT:
24                RETVAL
25        CLEANUP:
26                if (rv) owl_free(rv);
27
28void
29send_zwrite(cmd,msg)
30        char *cmd
31        char *msg
32        PREINIT:
33                int i;
34        CODE:
35                i = owl_zwrite_create_and_send_from_line(cmd, msg);
36
37char *
38ztext_stylestrip(ztext)
39        char *ztext
40        PREINIT:
41                char *rv = NULL;
42        CODE:
43                rv = owl_fmtext_ztext_stylestrip(ztext);
44                RETVAL = rv;
45        OUTPUT:
46                RETVAL
47        CLEANUP:
48                if (rv) owl_free(rv);
49
Note: See TracBrowser for help on using the repository browser.