feat(c): rename DecodeFunction to TSDecodeFunction
Keep a typedef for backwards compatibility until ABI 16.
This commit is contained in:
parent
dbe88f8bbb
commit
b75196bb81
4 changed files with 11 additions and 8 deletions
|
|
@ -51,12 +51,15 @@ typedef struct TSLookaheadIterator TSLookaheadIterator;
|
|||
// This function signature reads one code point from the given string,
|
||||
// returning the number of bytes consumed. It should write the code point
|
||||
// to the `code_point` pointer, or write -1 if the input is invalid.
|
||||
typedef uint32_t (*DecodeFunction)(
|
||||
typedef uint32_t (*TSDecodeFunction)(
|
||||
const uint8_t *string,
|
||||
uint32_t length,
|
||||
int32_t *code_point
|
||||
);
|
||||
|
||||
// Deprecated alias to be removed in ABI 16
|
||||
typedef TSDecodeFunction DecodeFunction;
|
||||
|
||||
typedef enum TSInputEncoding {
|
||||
TSInputEncodingUTF8,
|
||||
TSInputEncodingUTF16LE,
|
||||
|
|
@ -87,7 +90,7 @@ typedef struct TSInput {
|
|||
void *payload;
|
||||
const char *(*read)(void *payload, uint32_t byte_index, TSPoint position, uint32_t *bytes_read);
|
||||
TSInputEncoding encoding;
|
||||
DecodeFunction decode;
|
||||
TSDecodeFunction decode;
|
||||
} TSInput;
|
||||
|
||||
typedef struct TSParseState {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue