Changeset f1e629d for perlglue.xs


Ignore:
Timestamp:
Jul 6, 2003, 6:42:06 PM (21 years ago)
Author:
Erik Nygren <nygren@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
5d9c664
Parents:
675ce49
Message:
	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 perlwrap.pm
		(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 perlwrap.pm to contain perl code to be compiled into
	        the binary.  This is transformed into perlwrap.c by
		encapsulate.pl.
	Renamed readconfig.c to perlconfig.c and changed variables accordingly.
	Minor bugfixes in cmd.c and commands.c
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perlglue.xs

    r1fd0b25 rf1e629d  
    11static const char fileIdent[] = "$Id$";
    22
    3 #include "EXTERN.h"
    4 #include "perl.h"
    5 #include "XSUB.h"
     3#include <zephyr/zephyr.h>
     4#include <EXTERN.h>
     5#include <perl.h>
     6#include <XSUB.h>
    67
    78/* Yeah, we should just include owl.h, but curses and perl don't play nice. */
    8 extern char *owl_function_command(char *);
    9 extern void owl_free(void *);
     9extern char *owl_function_command(char *cmd);
     10extern void owl_free(void *x);
     11extern SV *owl_perlconfig_curmessage2hashref();
    1012extern int owl_zwrite_create_and_send_from_line(char *, char *);
    1113extern char *owl_function_ztext_stylestrip(char *);
     14extern void g;
     15extern int owl_global_get_cols(void*);
    1216
    1317MODULE = owl            PACKAGE = owl           
     
    2630                if (rv) owl_free(rv);
    2731
     32SV *
     33getcurmsg()
     34        CODE:
     35                ST(0) = owl_perlconfig_curmessage2hashref();
     36
     37int
     38getnumcols()
     39        CODE:
     40                RETVAL = owl_global_get_cols(&g);
     41        OUTPUT:
     42                RETVAL
     43
     44char *
     45zephyr_getrealm()
     46        CODE:
     47                RETVAL = ZGetRealm();
     48        OUTPUT:
     49                RETVAL
     50
     51char *
     52zephyr_getsender()
     53        CODE:
     54                RETVAL = ZGetSender();
     55        OUTPUT:
     56                RETVAL
     57
    2858void
    29 send_zwrite(cmd,msg)
     59zephyr_zwrite(cmd,msg)
    3060        char *cmd
    3161        char *msg
Note: See TracChangeset for help on using the changeset viewer.