1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-06-30 19:12:48 -05:00

bidi.c: update the API.

The input length field is now a size_t rather than an int, on general
principles. The return value is now void (we weren't using the
previous return value at all). And we now require the client to have
previously allocated a BidiContext, which will allow allocated storage
to be reused between runs, saving a lot of churn on malloc.

(However, the current BidiContext doesn't contain anything
interesting. I could have moved the existing mallocs into it, but
there's no point, since I'm about to rewrite the whole thing anyway.)
This commit is contained in:
Simon Tatham
2021-10-10 14:40:51 +01:00
parent 53e84b8933
commit caa16deb1c
5 changed files with 31 additions and 5 deletions

View File

@ -2359,7 +2359,9 @@ typedef struct bidi_char {
unsigned int origwc, wc;
unsigned short index, nchars;
} bidi_char;
int do_bidi(bidi_char *line, int count);
BidiContext *bidi_new_context(void);
void bidi_free_context(BidiContext *ctx);
void do_bidi(BidiContext *ctx, bidi_char *line, size_t count);
int do_shape(bidi_char *line, bidi_char *to, int count);
bool is_rtl(int c);