mirror of
https://git.sr.ht/~crc_/retroforth
synced 2024-11-16 19:48:56 +01:00
nga-c: begin implementing utf32 string functions
FossilOrigin-Name: 1761bf66ecc7107bf82d04486c8192c3278b727746e07c4b3cf31dd2a22e5fa4
This commit is contained in:
parent
5e521f3acd
commit
d008cfc764
2 changed files with 7 additions and 0 deletions
|
@ -29,6 +29,8 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "devices.h"
|
#include "devices.h"
|
||||||
|
|
||||||
|
#include "utf32.c"
|
||||||
|
|
||||||
#define ACTIVE vm->cpu[vm->active]
|
#define ACTIVE vm->cpu[vm->active]
|
||||||
#define TIB vm->memory[7]
|
#define TIB vm->memory[7]
|
||||||
#define TIB_END vm->memory[8]
|
#define TIB_END vm->memory[8]
|
||||||
|
|
5
vm/nga-c/utf32.c
Normal file
5
vm/nga-c/utf32.c
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
int utf32_length(int *s, int max) {
|
||||||
|
int l = 0;
|
||||||
|
while (*s++ != 0 && l < max) l++;
|
||||||
|
return l;
|
||||||
|
}
|
Loading…
Reference in a new issue