Commit Graph

14 Commits

Author SHA1 Message Date
Pawel Wodkowski
a5cfd43036 json: add va_arg versions for write_string and write_named_string
Change-Id: I22ca6db43f797d9e615208b251923d9ce61acec6
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/401024
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2018-02-23 15:27:16 -05:00
Pawel Wodkowski
d6408c0dd1 lib/json: add utility function for writeing key and value at once.
Change-Id: Ibbcf8cebff33159eff8345a5f0f5166cd18ea4b3
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/400600
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-02-20 13:05:36 -05:00
Dave Boutcher
f58bc31505 include: wrap header files in extern "C" for c++
Update all the header files in include/spdk to include
extern "C" declarations.

Change-Id: I43299f68e962d0df18c1b23fbbaa19bc924fcb96
Signed-off-by: Dave Boutcher <dboutcher@ocient.com>
Reviewed-on: https://review.gerrithub.io/390896
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-07 19:13:47 -05:00
Daniel Verkamp
429672d31b json: add function to write UTF-16LE strings
spdk_json_write_string_utf16le() writes a UTF-16LE string to a
JSON write context.

Change-Id: I413ffb8a3dee6e1b44ec96ce2415fd1b9c36320f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/368625
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-12 18:12:52 -04:00
Tomasz Zawadzki
ca2a1f291f json/test: remove executable permisions on unrelated files
This patch removes executable flag from couple files
that should not have it.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ib4287ec3763a4187a756c18845c61d8b50729820
Reviewed-on: https://review.gerrithub.io/368042
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-07-05 12:08:05 -04:00
Maciej Szwed
61119d7862 json: Added support for 64 bit unsigned value converter in json
This patch prepares support for 64 bit values that will be used in lvol bdev.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Ib5c8a438135e246c69887c4775c9ea6f0fa6eb1b
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/363344
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Piotr Pelpliński <piotr.pelplinski@intel.com>
2017-06-06 12:00:25 -04:00
Daniel Verkamp
7c1d827f78 json_util: remove spdk_json_number_to_double()
This function is no longer used for integer parsing, and it does not
work in locales with decimal separators other than '.', which is
required to be the decimal separator for JSON numbers.

Change-Id: I8e97e15cc2699e647652f83b71676c11d32d29ce
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/364134
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-06 12:00:25 -04:00
Daniel Verkamp
45cab335bc include: move standard includes into spdk/stdinc.h
This is the first step toward isolating standard C and POSIX headers
into a single replaceable header file.

Change-Id: I527297f5e7260b01103018ad3429922962ee9add
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-08 10:11:01 -07:00
Pawel Wodkowski
1bc2c5ab57 rpc: add bool-type decoder
Allow passing booleans in JSON.

Change-Id: I0b8f6c1579d8382b5b19a987ef5d913b4423c954
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2017-04-26 21:52:11 -07:00
Daniel Verkamp
1cb7e396a7 json: add printf-style spdk_json_write_string_fmt()
Change-Id: I9ea18072d4e54344f145a0b2d16aa6ab7f4d5e03
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-22 16:32:35 -07:00
Daniel Verkamp
d921d9ed9f json: add spdk_json_write_[u]int64()
Change-Id: I29c2c8f8546774842adf7e77e7bb550735c6fccc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-02 09:10:54 -07:00
Daniel Verkamp
c56b53a89e json: add flag to format when writing
Specify SPDK_JSON_WRITE_FLAG_FORMATTED when creating a write context to
output more human-readable JSON.

Change-Id: Ie1f0451496aae7e36e4cdb1f05edb4bc4963be17
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-31 10:23:13 -07:00
Daniel Verkamp
69c7ff06dc json: allow decoding of non-standard comments
Comments are not allowed in the JSON RFC, but some JSON libraries accept
JavaScript-style comments.

Add a flag that enables non-spec-compliant comment parsing.

Change-Id: I9dfb66bb46ecff1a22d8af5a9c50620686a4707c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-19 09:49:18 -07:00
Daniel Verkamp
f9193f4ce7 json: add JSON parser and encoder libraries
Change-Id: Id73fb7e300d66d31a7c3986c0334b6f56e284905
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-05-09 13:30:02 -07:00