Sha256: 6e88b919312eab0f70b1eea099ec25fa756bc530e305818c183a0cbf8565f9ad

Contents?: true

Size: 604 Bytes

Versions: 8

Compression:

Stored size: 604 Bytes

Contents

#include <wchar.h>

static const unsigned char table[] = {
#include "nonspacing.h"
};

static const unsigned char wtable[] = {
#include "wide.h"
};

int wcwidth(wchar_t wc)
{
	if (wc < 0xffU)
		return (wc+1 & 0x7f) >= 0x21 ? 1 : wc ? -1 : 0;
	if ((wc & 0xfffeffffU) < 0xfffe) {
		if ((table[table[wc>>8]*32+((wc&255)>>3)]>>(wc&7))&1)
			return 0;
		if ((wtable[wtable[wc>>8]*32+((wc&255)>>3)]>>(wc&7))&1)
			return 2;
		return 1;
	}
	if ((wc & 0xfffe) == 0xfffe)
		return -1;
	if (wc-0x20000U < 0x20000)
		return 2;
	if (wc == 0xe0001 || wc-0xe0020U < 0x5f || wc-0xe0100 < 0xef)
		return 0;
	return 1;
}

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
webruby-0.2.7 modules/emscripten/system/lib/libc/musl/src/ctype/wcwidth.c
webruby-0.2.5 modules/emscripten/system/lib/libc/musl/src/ctype/wcwidth.c
webruby-0.2.4 modules/emscripten/system/lib/libc/musl/src/ctype/wcwidth.c
webruby-0.2.2 modules/emscripten/system/lib/libc/musl/src/ctype/wcwidth.c
webruby-0.2.1 modules/emscripten/system/lib/libc/musl/src/ctype/wcwidth.c
webruby-0.1.2 modules/emscripten/system/lib/libc/musl/src/ctype/wcwidth.c
webruby-0.1.1 modules/emscripten/system/lib/libc/musl/src/ctype/wcwidth.c
webruby-0.1.0 modules/emscripten/system/lib/libc/musl/src/ctype/wcwidth.c