Mercurial > vim
comparison src/structs.h @ 7883:98a96e0ca73b v7.4.1238
commit https://github.com/vim/vim/commit/56ead341a75e1a0395eee94a3280c67e2278a57e
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Feb 2 18:20:08 2016 +0100
patch 7.4.1238
Problem: Can't handle two messages right after each other.
Solution: Find the end of the JSON. Read more when incomplete. Add a C
test for the JSON decoding.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 02 Feb 2016 18:30:04 +0100 |
parents | 17e6ff1a74f1 |
children | e875f0fbd9c0 |
comparison
equal
deleted
inserted
replaced
7882:a3d3ab0f7b27 | 7883:98a96e0ca73b |
---|---|
2685 } context_sha256_T; | 2685 } context_sha256_T; |
2686 | 2686 |
2687 /* | 2687 /* |
2688 * Structure used for reading in json_decode(). | 2688 * Structure used for reading in json_decode(). |
2689 */ | 2689 */ |
2690 typedef struct | 2690 struct js_reader |
2691 { | 2691 { |
2692 char_u *js_buf; /* text to be decoded */ | 2692 char_u *js_buf; /* text to be decoded */ |
2693 char_u *js_end; /* NUL in js_buf when js_eof is FALSE */ | 2693 char_u *js_end; /* NUL in js_buf */ |
2694 int js_used; /* bytes used from js_buf */ | 2694 int js_used; /* bytes used from js_buf */ |
2695 int js_eof; /* when TRUE js_buf is all there is */ | 2695 int (*js_fill)(struct js_reader *); |
2696 int (*js_fill)(void *); /* function to fill the buffer */ | 2696 /* function to fill the buffer or NULL; |
2697 void *js_cookie; /* passed to js_fill */ | 2697 * return TRUE when the buffer was filled */ |
2698 } js_read_T; | 2698 void *js_cookie; /* can be used by js_fill */ |
2699 }; | |
2700 typedef struct js_reader js_read_T; |