mirror of
https://github.com/irssi/irssi.git
synced 2026-08-18 16:12:30 +02:00
Merge pull request #973 from ailin-nemui/perl-wcwidth
expose wcwidth and related to perl
This commit is contained in:
commit
1c6f256098
2 changed files with 43 additions and 0 deletions
|
|
@ -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
|
||||
#*******************************
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue