Browse Source

Improve CI-related comments a bit

PUBLISHED_FROM=b16b5d7805da449c85f4fe22f3fcc4a4e68cbf00
Dmitry Frank 9 years ago
parent
commit
e9e2aab0e7
5 changed files with 30 additions and 30 deletions
  1. 14 14
      docs/api/json_printf.md
  2. 7 7
      docs/api/json_scanf.md
  3. 4 4
      docs/api/json_walk.md
  4. 3 3
      docs/features.md
  5. 2 2
      docs/license.md

+ 14 - 14
docs/api/json_printf.md

@@ -2,15 +2,15 @@
 title: json_printf()
 ---
 
-Frozen printing API is pluggable. Out of the box, Frozen provides a way
+The Frozen printing API is pluggable. Out of the box, Frozen provides a way
 to print to a string buffer or to an opened file stream. It is easy to
-to tell Frozen to print to other destination - for example, to a socket, etc.
-Frozen does it by defining an "output context" descriptor, which has
-a pointer to low-level printing function. If you want to print to some other
-destination, just define your specific printing function and initialize
+to tell Frozen to print to another destination, for example, to a socket, etc.
+Frozen does this by defining an "output context" descriptor which has
+a pointer to a low-level printing function. If you want to print to another
+destination, just define your specific printing function and initialise
 output context with it.
 
-This is the definition of output context descriptor:
+This is the definition of the output context descriptor:
 
 ```c
 struct json_out {
@@ -27,7 +27,7 @@ struct json_out {
 };
 ```
 
-Frozen provides two helper macros to initialize two builtin output
+Frozen provides two helper macros to initialise two built-in output
 descriptors:
 
 ```c
@@ -41,11 +41,11 @@ int json_printf(struct json_out *, const char *fmt, ...);
 int json_vprintf(struct json_out *, const char *fmt, va_list ap);
 ```
 
-Generate formatted output into a given sting buffer.
-String values get escaped when printed (see `%M` specifier).
-This is a superset of printf() function, with extra format specifiers:
-- `%B` print json boolean, `true` or `false`. Accepts an `int`.
-- `%Q` print quoted escaped string or `null`. Accepts a `const char *`.
+Generates formatted output into a given sting buffer.
+String values escape when printed (see `%M` specifier).
+This is a superset of the printf() function, with extra format specifiers:
+- `%B` prints JSON boolean, `true` or `false`. Accepts an `int`.
+- `%Q` prints quoted escaped string or `null`. Accepts a `const char *`.
 - `%.*Q` like `%Q` but accepts the length of the string explicitly, pretty much like `%.*s`.
 Embedded NUL bytes are supported and will be properly encoded as `\u0000`.
 Accepts an `int` length and a `const char *`.
@@ -54,7 +54,7 @@ can consume more parameters.
 
 `json_printf()` also auto-escapes keys.
 
-Return number of bytes printed. If the return value is bigger then the
+Returns the number of bytes printed. If the return value is bigger then the
 supplied buffer, that is an indicator of overflow. In the overflow case,
 overflown bytes are not printed.
 
@@ -64,4 +64,4 @@ int json_printf_array(struct json_out *, va_list *ap);
 
 A helper `%M` callback that prints contiguous C arrays.
 Consumes `void *array_ptr, size_t array_size, size_t elem_size, char *fmt`
-Return number of bytes printed.
+Returns number of bytes printed.

+ 7 - 7
docs/api/json_scanf.md

@@ -11,11 +11,11 @@ typedef void (*json_scanner_t)(const char *str, int len, void *user_data);
 
 ```
 
-Scan JSON string `str`, performing scanf-like conversions according to `fmt`.
+Scans the JSON string `str`, performing scanf-like conversions according to `fmt`.
 `fmt` uses `scanf()`-like format, with the following differences:
 
 1. Object keys in the format string don't have to be quoted, e.g. "{key: %d}"
-2. Order of keys in a format string does not matter, and format string may
+2. Order of keys in the format string does not matter, and the format string may
    omit keys to fetch only those that are of interest, for example,
    assume `str` is a JSON string `{ "a": 123, "b": "hi", c: true }`.
    We can fetch only the value of the `c` key:
@@ -25,14 +25,14 @@ Scan JSON string `str`, performing scanf-like conversions according to `fmt`.
       ```
 3. Several extra format specifiers are supported:
    - `%B`: consumes `int *`, expects boolean `true` or `false`.
-   - `%Q`: consumes `char **`, expects quoted, JSON-encoded string. Scanned
-      string is malloc-ed, caller must free() the string. Scanned string
+   - `%Q`: consumes `char **`, expects quoted, JSON-encoded string. A scanned
+      string is malloc-ed, caller must free() the string. The scanned string
       is a JSON decoded, unescaped UTF-8 string.
    - `%M`: consumes custom scanning function pointer and
       `void *user_data` parameter - see json_scanner_t definition.
    - `%T`: consumes `struct json_token *`, fills it out with matched token.
 
-Return number of elements successfully scanned & converted.
+Returns the number of elements successfully scanned & converted.
 Negative number means scan error.
 
 
@@ -43,6 +43,6 @@ int json_scanf_array_elem(const char *s, int len,
                           struct json_token *token);
 ```
 
-A helper function to scan array item with given path and index.
+A helper function to scan an array item with given path and index.
 Fills `token` with the matched JSON token.
-Return 0 if no array element found, otherwise non-0.
+Returns 0 if no array element found, otherwise non-0.

+ 4 - 4
docs/api/json_walk.md

@@ -44,16 +44,16 @@ int json_walk(const char *json_string, int json_string_length,
 ```
 
 `json_walk()` is a low-level, callback based parsing API.
-`json_walk()` calls given callback function for each scanned value.
+`json_walk()` calls a given callback function for each scanned value.
 
 Callback receives a name, a path to the value, a JSON token that points to the
-value, and arbitrary user data pointer.
+value and an arbitrary user data pointer.
 
 The path is constructed using this rule:
 - Root element has "" (empty string) path
 - When an object starts, `.` (dot) is appended to the path
 - When an object key is parsed, a key name is appended to the path
-- When an array is parsed, for each element an `[ELEMENT_INDEX]` is appended
+- When an array is parsed, an `[ELEMENT_INDEX]` is appended for each element
 
 For example, consider the following json string:
 `{ "foo": 123, "bar": [ 1, 2, { "baz": true } ] }`.
@@ -77,5 +77,5 @@ If top-level element is an array: `[1, {"foo": 2}]`
 - type: `JSON_TYPE_OBJECT_END`, name: `NULL`, path: `"[1]"`, value: `"{\"foo\": 2}"`
 - type: `JSON_TYPE_ARRAY_END`, name: `NULL`, path: `""`, value: `"[1, {"foo": 2}]"`
 
-If top-level element is an scalar: `true`
+If top-level element is a scalar: `true`
 - type: `JSON_TYPE_TRUE`, name: `NULL`, path: `""`, value: `"true"`

+ 3 - 3
docs/features.md

@@ -6,9 +6,9 @@ title: "Features"
 - Simple, easy to understand API
 - Very small footprint
 - No dependencies
-- Code is strict ISO C and strict ISO C++ at the same time
-- Specialized for embedded use case: prints and scans directly to/from
+- Code is strictly ISO C and strictly ISO C++ compliant
+- Specialised for embedded use cases: prints and scans directly to/from
   C/C++ variables
 - Parser provides low-level callback API and high-level scanf-like API
 - Supports superset of JSON: allows non-quoted identifiers as object keys
-- Complete 100% test coverage
+- 100% test coverage

+ 2 - 2
docs/license.md

@@ -8,10 +8,10 @@ licenses.
 
 Commercial Projects: Once your project becomes commercialised GPLv2 licensing
 dictates that you need to either open your source fully or purchase a
-commercial license. Cesanta offer full, royalty-free commercial licenses
+commercial license. Cesanta offers full, royalty-free commercial licenses
 without any GPL restrictions. If your needs require a custom license, we’d be
 happy to work on a solution with you. [Contact us for
 pricing](https://www.cesanta.com/contact).
 
 Prototyping: While your project is still in prototyping stage and not for sale,
-you can use Frozen’s open source code without license restrictions.
+you can use Frozen’s open source code without any license restrictions.