1ASON_READ(3) User Manuals ASON_READ(3)
2
3
4
6 ason_read, ason_readn - Parse ASON values into ason_t objects.
7
8
10 #include <ason/ason.h>
11 #include <ason/read.h>
12
13 ason_t *ason_read(const char *text, ...);
14 ason_t *ason_readn(const char *text, size_t length, ...);
15
16 #include <ason/namespace.h>
17
18 ason_t *ason_ns_read(ason_ns_t *ns, const char *text, ...);
19 ason_t *ason_ns_readn(ason_ns_t *ns, const char *text, size_t length,
20 ...);
21
23 ason_read parses an ASON value and creates an ason_t representation of
24 that value. ason_readn is the same, but reads only length characters
25 of the string.
26
27 ason_ns_read and ason_ns_readn are the same, but take an additional
28 argument, ns, which is a namespace to evaluate variables from, and
29 store variables to. See ason_namespace(3).
30
32 Each of these functions allows for additional arguments which will be
33 converted to ASON values and put in the appropriate place within the
34 parsed value. The following tokens can be placed in the string to indi‐
35 cate where additional arguments should be consumed:
36
37 ?i - An integer argument. Converted to a numeric ASON value.
38 ?u - An unsigned integer argument. Converted to a numeric ASON value.
39 ?I - A 64-bit integer argument. Converted to a numeric ASON value.
40 ?U - A 64-bit unsigned integer argument. Converted to a numeric ASON
41 value.
42 ?s - A string argument. Converted to an ASON string value. Can be used
43 as a key value in objects. ? - An ason_t value. Used as-is.
44
45
47 libason will try to negotiate between the current locale and the JSON-
48 mandated UTF-8 encoding, but for best results, users should deal
49 directly in UTF-8.
50
52 All functions should always return a valid pointer to ason_t.
53
55 ason(3) ason_values(3)
56
58 Casey Dahlin <casey.dahlin@gmail.com>
59
60
61
62
63
64Linux JANUARY 2014 ASON_READ(3)