expose wcwidth and related to perl

This commit is contained in:
ailin-nemui 2018-11-12 13:14:02 +01:00
commit 9e5e5d8625
2 changed files with 42 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
#*******************************