Changeset 39e81f7


Ignore:
Timestamp:
Oct 3, 2009, 8:45:52 PM (8 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
0c4a190
Parents:
09ff1eb
git-author:
Nelson Elhage <nelhage@mit.edu> (10/02/09 22:25:31)
git-committer:
Nelson Elhage <nelhage@mit.edu> (10/03/09 20:45:52)
Message:
Return unicode strings to perl.

Define a new typedef, 'utf8', in perlglue.xs, and use a typemap that
indicates that values of type utf8* should be returned to perl as
Unicode strings.

There is no good reason that get_{data,config}_dir should not also
return unicode, except that making them do so crashes my barnowl in
some extremely strange and hard-to-debug manner.
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • Makefile.am

    r8830f79f r39e81f7  
    4343GEN_H = owl_prototypes.h
    4444
     45TYPEMAP = typemap
     46
    4547BUILT_SOURCES = $(GEN_C) $(GEN_H)
    4648
     
    5456proto: owl_prototypes.h
    5557
    56 perlglue.c: perlglue.xs
    57         $(AM_V_GEN)perl $(XSUBPPDIR)/xsubpp $(XSUBPPFLAGS) -prototypes perlglue.xs > perlglue.c
     58perlglue.c: perlglue.xs $(TYPEMAP)
     59        $(AM_V_GEN)perl $(XSUBPPDIR)/xsubpp $(XSUBPPFLAGS) -prototypes perlglue.xs -typemap $(TYPEMAP) > perlglue.c
    5860
    5961varstubs.c: stubgen.pl variable.c
  • perlglue.xs

    r8830f79f r39e81f7  
    99
    1010#define SV_IS_CODEREF(sv) (SvROK((sv)) && SvTYPE(SvRV((sv))) == SVt_PVCV)
     11
     12typedef char utf8;
    1113
    1214        /*************************************************************
     
    2931MODULE = BarnOwl                PACKAGE = BarnOwl
    3032
    31 const char *
     33const utf8 *
    3234command(cmd, ...)
    3335        const char *cmd
     
    7779                RETVAL
    7880
    79 const char *
     81const utf8 *
    8082zephyr_getrealm()
    8183        CODE:
     
    8486                RETVAL
    8587
    86 const char *
     88const utf8 *
    8789zephyr_getsender()
    8890        CODE:
     
    100102                i = owl_zwrite_create_and_send_from_line(cmd, msg);
    101103
    102 const char *
     104const utf8 *
    103105ztext_stylestrip(ztext)
    104106        const char *ztext
     
    113115                if (rv) owl_free(rv);
    114116
    115 const char *
     117const utf8 *
    116118zephyr_smartstrip_user(in)
    117119        const char *in
     
    128130                owl_free(rv);
    129131
    130 const char *
     132const utf8 *
    131133zephyr_getsubs()
    132134        PREINIT:
     
    309311        }
    310312
    311 const char *
     313const utf8 *
    312314wordwrap(in, cols)
    313315        const char *in
     
    321323                RETVAL
    322324        CLEANUP:
    323                 if (rv) owl_free(rv);
     325                if (rv)
     326                        owl_free(rv);
    324327
    325328void
     
    424427                RETVAL
    425428
    426 const char *
     429const utf8 *
    427430skiptokens(str, n)
    428431        const char *str;
     
    564567                RETVAL
    565568
    566 const char *
     569const utf8 *
    567570get_region()
    568571        PREINIT:
Note: See TracChangeset for help on using the changeset viewer.