-
Notifications
You must be signed in to change notification settings - Fork 0
/
yrs.h
61 lines (49 loc) · 1.31 KB
/
yrs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef yrs_h
#define yrs_h
/* Autogenerated by cbindgen. Do not modify. */
#include <stdint.h>
#include <stdlib.h>
typedef struct Doc Doc;
/**
* # Safety
* This must be called with a valid doc pointer
* change must point to a valid memory location with at least len bytes
*/
void yrs_apply_update(Doc *doc, uintptr_t len, const uint8_t *update);
/**
* # Safety
* This must be called with a valid doc pointer
*/
intptr_t yrs_encode_state_as_update(Doc *doc);
/**
* # Safety
* This must be called with a valid doc pointer
*/
void yrs_free(Doc *doc);
Doc *yrs_init(void);
/**
* # Safety
* This must be called with a valid doc pointer
*/
void yrs_insert(Doc *doc, uint32_t index, char change);
/**
* # Safety
*
* This must be called with a valid doc pointer
* the buffer must be a valid pointer pointing to at least as much space as was
* required by the previous binary result call
*/
void yrs_read_binary_buffer(Doc *doc, uint8_t *buffer);
/**
* # Safety
* This must be called with a valid doc pointer
* and buffer must be a valid pointer of at least the number of bytes returned by the previous
* call that generated a text result
*/
void yrs_read_text_buffer(Doc *doc, char *buffer);
/**
* # Safety
* This must be called with a valid doc pointer
*/
intptr_t yrs_to_string(Doc *doc);
#endif /* yrs_h */