diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-01-23 19:46:28 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-01-23 19:46:28 +0100 |
commit | 520e1e41f35b063ede63b41738c82d6636e78c34 (patch) | |
tree | 4c6a94e4e8f3f2047b91886077d4ecb916b30401 /src/proto | |
parent | 6920c72d4d62c8dc5596e9f392e38204f561d7af (diff) | |
download | vim-520e1e41f35b063ede63b41738c82d6636e78c34.zip |
patch 7.4.1154
Problem: No support for JSON.
Solution: Add jsonencode() and jsondecode(). Also add v:false, v:true,
v:null and v:none.
Diffstat (limited to 'src/proto')
-rw-r--r-- | src/proto/eval.pro | 5 | ||||
-rw-r--r-- | src/proto/json.pro | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/proto/eval.pro b/src/proto/eval.pro index fae403a50..f6ad4b49e 100644 --- a/src/proto/eval.pro +++ b/src/proto/eval.pro @@ -46,6 +46,7 @@ int do_unlet(char_u *name, int forceit); void del_menutrans_vars(void); char_u *get_user_var_name(expand_T *xp, int idx); list_T *list_alloc(void); +int rettv_list_alloc(typval_T *rettv); void list_unref(list_T *l); void list_free(list_T *l, int recurse); listitem_T *listitem_alloc(void); @@ -61,11 +62,13 @@ int list_append_string(list_T *l, char_u *str, int len); int list_insert_tv(list_T *l, typval_T *tv, listitem_T *item); void list_insert(list_T *l, listitem_T *ni, listitem_T *item); void vimlist_remove(list_T *l, listitem_T *item, listitem_T *item2); +int get_copyID(void); int garbage_collect(void); int set_ref_in_ht(hashtab_T *ht, int copyID, list_stack_T **list_stack); int set_ref_in_list(list_T *l, int copyID, ht_stack_T **ht_stack); int set_ref_in_item(typval_T *tv, int copyID, ht_stack_T **ht_stack, list_stack_T **list_stack); dict_T *dict_alloc(void); +int rettv_dict_alloc(typval_T *rettv); void dict_unref(dict_T *d); void dict_free(dict_T *d, int recurse); dictitem_T *dictitem_alloc(char_u *key); @@ -76,6 +79,7 @@ int dict_add_list(dict_T *d, char *key, list_T *list); dictitem_T *dict_find(dict_T *d, char_u *key, int len); char_u *get_dict_string(dict_T *d, char_u *key, int save); long get_dict_number(dict_T *d, char_u *key); +int string2float(char_u *text, float_T *value); char_u *get_function_name(expand_T *xp, int idx); char_u *get_expr_name(expand_T *xp, int idx); int func_call(char_u *name, typval_T *args, dict_T *selfdict, typval_T *rettv); @@ -100,6 +104,7 @@ void free_tv(typval_T *varp); void clear_tv(typval_T *varp); long get_tv_number_chk(typval_T *varp, int *denote); char_u *get_tv_string_chk(typval_T *varp); +char_u *get_tv_string_buf_chk(typval_T *varp, char_u *buf); char_u *get_var_value(char_u *name); void new_script_vars(scid_T id); void init_var_dict(dict_T *dict, dictitem_T *dict_var, int scope); diff --git a/src/proto/json.pro b/src/proto/json.pro new file mode 100644 index 000000000..6920f516e --- /dev/null +++ b/src/proto/json.pro @@ -0,0 +1,5 @@ +/* json.c */ +char_u *json_encode(typval_T *val); +void json_encode_item(garray_T *gap, typval_T *val, int copyID); +void json_decode(js_read_T *reader, typval_T *res); +/* vim: set ft=c : */ |