Merge pull request #973 from ailin-nemui/perl-wcwidth

expose wcwidth and related to perl
This commit is contained in:
ailin-nemui 2018-11-29 10:18:16 +01:00 committed by GitHub
commit 1c6f256098
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 0 deletions

View file

@ -2,6 +2,8 @@
#include "module.h"
#include "irssi-version.h"
#include "core.h"
#include "utf8.h"
#include "recode.h"
#include "pidwait.h"
#include "session.h"
@ -687,6 +689,25 @@ CODE:
OUTPUT:
RETVAL
int
string_width(str)
char *str
C_ARGS:
str, is_utf8() ? TREAT_STRING_AS_UTF8 : TREAT_STRING_AS_BYTES
void
string_chars_for_width(str, width)
char *str
unsigned int width
PREINIT:
int retval;
unsigned int bytes;
PPCODE:
retval = string_chars_for_width(str, is_utf8() ? TREAT_STRING_AS_UTF8 : TREAT_STRING_AS_BYTES, width, &bytes);
mXPUSHi(retval);
mXPUSHu(bytes);
#*******************************
MODULE = Irssi::Core PACKAGE = Irssi::Server
#*******************************