source: perlglue.xs @ fe6f1d3

Last change on this file since fe6f1d3 was f1e629d, checked in by Erik Nygren <>, 21 years ago
New API for perl message formatting functions. Legacy variables are still supported for owl::format_msg and owl::receive_msg, but these functions are now also passed an owl::Message object which contains methods for accessing the contents of the message. See (and docs TBD) for the available methods. *** WARNING: The exact API for owl::Message has *** not yet stabilized. Added "style" command for creating new styles. Usage: style <name> perl <function_name> Added support for "show styles". Changed global style table from list to dictionary. Changed AIM password prompt from "Password:" to "AIM Password:". Messages are reformatted after a window resize to allow styles to take into account the width of the window. When perl throws an error, the message is put in the msgwin if possible. Added perl functions for: owl::getcurmsg() -- returns an owl::Message object for the active message in the current view. owl::getnumcols() -- returns the column width of the window owl::zephyr_getrealm() -- returns the zephyr realm owl::zephyr_getsender() -- returns the zephyr sender Made owl::COMMAND("foo"); be syntactic sugar for owl::command("COMMAND foo"); *** Is this a good or bad idea? *** This feature may be taken out before release. Added to contain perl code to be compiled into the binary. This is transformed into perlwrap.c by Renamed readconfig.c to perlconfig.c and changed variables accordingly. Minor bugfixes in cmd.c and commands.c
  • Property mode set to 100644
File size: 1.3 KB
[83a9b63]1static const char fileIdent[] = "$Id$";
[f1e629d]3#include <zephyr/zephyr.h>
4#include <EXTERN.h>
5#include <perl.h>
6#include <XSUB.h>
8/* Yeah, we should just include owl.h, but curses and perl don't play nice. */
[f1e629d]9extern char *owl_function_command(char *cmd);
10extern void owl_free(void *x);
11extern SV *owl_perlconfig_curmessage2hashref();
[e1c4636]12extern int owl_zwrite_create_and_send_from_line(char *, char *);
[1fd0b25]13extern char *owl_function_ztext_stylestrip(char *);
[f1e629d]14extern void g;
15extern int owl_global_get_cols(void*);
17MODULE = owl            PACKAGE = owl           
19char *
21        char *cmd
22        PREINIT:
23                char *rv = NULL;
24        CODE:
25                rv = owl_function_command(cmd);
26                RETVAL = rv;   
27        OUTPUT:
28                RETVAL
29        CLEANUP:
30                if (rv) owl_free(rv);
[f1e629d]32SV *
34        CODE:
35                ST(0) = owl_perlconfig_curmessage2hashref();
39        CODE:
40                RETVAL = owl_global_get_cols(&g);
41        OUTPUT:
42                RETVAL
44char *
46        CODE:
47                RETVAL = ZGetRealm();
48        OUTPUT:
49                RETVAL
51char *
53        CODE:
54                RETVAL = ZGetSender();
55        OUTPUT:
56                RETVAL
[e1c4636]60        char *cmd
61        char *msg
62        PREINIT:
63                int i;
64        CODE:
65                i = owl_zwrite_create_and_send_from_line(cmd, msg);
67char *
69        char *ztext
70        PREINIT:
71                char *rv = NULL;
72        CODE:
[1fd0b25]73                rv = owl_function_ztext_stylestrip(ztext);
[e1c4636]74                RETVAL = rv;
75        OUTPUT:
76                RETVAL
77        CLEANUP:
78                if (rv) owl_free(rv);
Note: See TracBrowser for help on using the repository browser.