Debian Codegraph @

src/vendor/azure-uamqp-c/devdoc/amqpvalue_requirements.md

raw
1 # amqpvalue requirements
2
3 ## Overview
4
5 `amqpvalue` is module that encapsulates the typesystem of AMQP. It allows, creating AMQP type values from native C types, destroying them and converting the types to native C types.
6
7 ## Exposed API
8
9 ```C
10 typedef struct AMQP_VALUE_DATA_TAG* AMQP_VALUE;
11 typedef unsigned char uuid[16];
12 typedef int64_t timestamp;
13
14 typedef struct amqp_binary_TAG
15 {
16 const void* bytes;
17 uint32_t length;
18 } amqp_binary;
19
20 /* type handling */
21 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_null);
22 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_boolean, bool, bool_value);
23 MOCKABLE_FUNCTION(, int, amqpvalue_get_boolean, AMQP_VALUE, value, bool*, bool_value);
24 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_ubyte, unsigned char, ubyte_value);
25 MOCKABLE_FUNCTION(, int, amqpvalue_get_ubyte, AMQP_VALUE, value, unsigned char*, ubyte_value);
26 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_ushort, uint16_t, ushort_value);
27 MOCKABLE_FUNCTION(, int, amqpvalue_get_ushort, AMQP_VALUE, value, uint16_t*, ushort_value);
28 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_uint, uint32_t, uint_value);
29 MOCKABLE_FUNCTION(, int, amqpvalue_get_uint, AMQP_VALUE, value, uint32_t*, uint_value);
30 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_ulong, uint64_t, ulong_value);
31 MOCKABLE_FUNCTION(, int, amqpvalue_get_ulong, AMQP_VALUE, value, uint64_t*, ulong_value);
32 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_byte, char, byte_value);
33 MOCKABLE_FUNCTION(, int, amqpvalue_get_byte, AMQP_VALUE, value, char*, byte_value);
34 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_short, int16_t, short_value);
35 MOCKABLE_FUNCTION(, int, amqpvalue_get_short, AMQP_VALUE, value, int16_t*, short_value);
36 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_int, int32_t, int_value);
37 MOCKABLE_FUNCTION(, int, amqpvalue_get_int, AMQP_VALUE, value, int32_t*, int_value);
38 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_long, int64_t, long_value);
39 MOCKABLE_FUNCTION(, int, amqpvalue_get_long, AMQP_VALUE, value, int64_t*, long_value);
40 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_float, float, float_value);
41 MOCKABLE_FUNCTION(, int, amqpvalue_get_float, AMQP_VALUE, value, float*, float_value);
42 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_double, double, double_value);
43 MOCKABLE_FUNCTION(, int, amqpvalue_get_double, AMQP_VALUE, value, double*, double_value);
44 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_char, uint32_t, char_value);
45 MOCKABLE_FUNCTION(, int, amqpvalue_get_char, AMQP_VALUE, value, uint32_t*, char_value);
46 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_timestamp, int64_t, timestamp_value);
47 MOCKABLE_FUNCTION(, int, amqpvalue_get_timestamp, AMQP_VALUE, value, int64_t*, timestamp_value);
48 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_uuid, uuid, uuid_value);
49 MOCKABLE_FUNCTION(, int, amqpvalue_get_uuid, AMQP_VALUE, value, uuid*, uuid_value);
50 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_binary, amqp_binary, binary_value);
51 MOCKABLE_FUNCTION(, int, amqpvalue_get_binary, AMQP_VALUE, value, amqp_binary*, binary_value);
52 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_string, const char*, string_value);
53 MOCKABLE_FUNCTION(, int, amqpvalue_get_string, AMQP_VALUE, value, const char**, string_value);
54 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_symbol, const char*, symbol_value);
55 MOCKABLE_FUNCTION(, int, amqpvalue_get_symbol, AMQP_VALUE, value, const char**, symbol_value);
56 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_list);
57 MOCKABLE_FUNCTION(, int, amqpvalue_set_list_item_count, AMQP_VALUE, list, uint32_t, count);
58 MOCKABLE_FUNCTION(, int, amqpvalue_get_list_item_count, AMQP_VALUE, list, uint32_t*, count);
59 MOCKABLE_FUNCTION(, int, amqpvalue_set_list_item, AMQP_VALUE, list, uint32_t, index, AMQP_VALUE, list_item_value);
60 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_get_list_item, AMQP_VALUE, list, size_t, index);
61 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_map);
62 MOCKABLE_FUNCTION(, int, amqpvalue_set_map_value, AMQP_VALUE, map, AMQP_VALUE, key, AMQP_VALUE, value);
63 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_get_map_value, AMQP_VALUE, map, AMQP_VALUE, key);
64 MOCKABLE_FUNCTION(, int, amqpvalue_get_map_pair_count, AMQP_VALUE, map, uint32_t*, pair_count);
65 MOCKABLE_FUNCTION(, int, amqpvalue_get_map_key_value_pair, AMQP_VALUE, map, uint32_t, index, AMQP_VALUE*, key, AMQP_VALUE*, value);
66 MOCKABLE_FUNCTION(, int, amqpvalue_get_map, AMQP_VALUE, from_value, AMQP_VALUE*, map);
67 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_array);
68 MOCKABLE_FUNCTION(, int, amqpvalue_get_array_item_count, AMQP_VALUE, value, uint32_t*, count);
69 MOCKABLE_FUNCTION(, int, amqpvalue_add_array_item, AMQP_VALUE, value, AMQP_VALUE, array_item_value);
70 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_get_array_item, AMQP_VALUE, value, uint32_t, index);
71 MOCKABLE_FUNCTION(, int, amqpvalue_get_array, AMQP_VALUE, value, AMQP_VALUE*, array_value);
72 MOCKABLE_FUNCTION(, AMQP_TYPE, amqpvalue_get_type, AMQP_VALUE, value);
73
74 MOCKABLE_FUNCTION(, void, amqpvalue_destroy, AMQP_VALUE, value);
75
76 MOCKABLE_FUNCTION(, bool, amqpvalue_are_equal, AMQP_VALUE, value1, AMQP_VALUE, value2);
77 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_clone, AMQP_VALUE, value);
78
79 /* encoding */
80 typedef int (*AMQPVALUE_ENCODER_OUTPUT)(void* context, const unsigned char* bytes, size_t length);
81
82 MOCKABLE_FUNCTION(, int, amqpvalue_encode, AMQP_VALUE, value, AMQPVALUE_ENCODER_OUTPUT, encoder_output, void*, context);
83 MOCKABLE_FUNCTION(, int, amqpvalue_get_encoded_size, AMQP_VALUE, value, size_t*, encoded_size);
84
85 /* decoding */
86 typedef struct AMQPVALUE_DECODER_HANDLE_DATA_TAG* AMQPVALUE_DECODER_HANDLE;
87 typedef void(*ON_VALUE_DECODED)(void* context, AMQP_VALUE decoded_value);
88
89 MOCKABLE_FUNCTION(, AMQPVALUE_DECODER_HANDLE, amqpvalue_decoder_create, ON_VALUE_DECODED, on_value_decoded, void*, callback_context);
90 MOCKABLE_FUNCTION(, void, amqpvalue_decoder_destroy, AMQPVALUE_DECODER_HANDLE, handle);
91 MOCKABLE_FUNCTION(, int, amqpvalue_decode_bytes, AMQPVALUE_DECODER_HANDLE, handle, const unsigned char*, buffer, size_t, size);
92
93 /* misc for now, not spec'd */
94 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_get_inplace_descriptor, AMQP_VALUE, value);
95 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_get_inplace_described_value, AMQP_VALUE, value);
96
97 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_composite, AMQP_VALUE, descriptor, uint32_t, list_size);
98 MOCKABLE_FUNCTION(, int, amqpvalue_set_composite_item, AMQP_VALUE, value, uint32_t, index, AMQP_VALUE, item_value);
99 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_get_composite_item, AMQP_VALUE, value, size_t, index);
100 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_described, AMQP_VALUE, descriptor, AMQP_VALUE, value);
101 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_composite_with_ulong_descriptor, uint64_t, descriptor);
102 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_get_list_item_in_place, AMQP_VALUE, value, size_t, index);
103 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_get_composite_item_in_place, AMQP_VALUE, value, size_t, index);
104 MOCKABLE_FUNCTION(, int, amqpvalue_get_composite_item_count, AMQP_VALUE, value, uint32_t*, item_count);
105 ```
106
107 ### amqpvalue_create_null
108
109 ```C
110 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_null);
111 ```
112
113 **SRS_AMQPVALUE_01_001: [**amqpvalue_create_null shall return a handle to an AMQP_VALUE that stores a null value.**]**
114 **SRS_AMQPVALUE_01_002: [**If allocating the AMQP_VALUE fails then amqpvalue_create_null shall return NULL.**]**
115
116 ### amqpvalue_create_boolean
117
118 ```C
119 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_boolean, bool, bool_value);
120 ```
121
122 **SRS_AMQPVALUE_01_006: [**amqpvalue_create_boolean shall return a handle to an AMQP_VALUE that stores a boolean value.**]**
123 **SRS_AMQPVALUE_01_007: [**If allocating the AMQP_VALUE fails then amqpvalue_create_boolean shall return NULL.**]**
124
125 ### amqpvalue_get_boolean
126
127 ```C
128 MOCKABLE_FUNCTION(, int, amqpvalue_get_boolean, AMQP_VALUE, value, bool*, bool_value);
129 ```
130
131 **SRS_AMQPVALUE_01_008: [**amqpvalue_get_boolean shall fill in the bool_value argument the Boolean value stored by the AMQP value indicated by the value argument.**]**
132 **SRS_AMQPVALUE_01_010: [**On success amqpvalue_get_boolean shall return 0.**]**
133 **SRS_AMQPVALUE_01_009: [**If any of the arguments is NULL then amqpvalue_get_boolean shall return a non-zero value.**]**
134 **SRS_AMQPVALUE_01_011: [**If the type of the value is not Boolean, then amqpvalue_get_boolean shall return a non-zero value.**]**
135
136 ### amqpvalue_create_ubyte
137
138 ```C
139 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_ubyte, unsigned char, ubyte_value);
140 ```
141
142 **SRS_AMQPVALUE_01_032: [**amqpvalue_create_ubyte shall return a handle to an AMQP_VALUE that stores a unsigned char value.**]**
143 **SRS_AMQPVALUE_01_033: [**If allocating the AMQP_VALUE fails then amqpvalue_create_ubyte shall return NULL.**]**
144
145 ### amqpvalue_get_ubyte
146
147 ```C
148 MOCKABLE_FUNCTION(, int, amqpvalue_get_ubyte, AMQP_VALUE, value, unsigned char*, ubyte_value);
149 ```
150
151 **SRS_AMQPVALUE_01_034: [**amqpvalue_get_ubyte shall fill in the ubyte_value argument the unsigned char value stored by the AMQP value indicated by the value argument.**]**
152 **SRS_AMQPVALUE_01_035: [**On success amqpvalue_get_ubyte shall return 0.**]**
153 **SRS_AMQPVALUE_01_036: [**If any of the arguments is NULL then amqpvalue_get_ubyte shall return a non-zero value.**]**
154 **SRS_AMQPVALUE_01_037: [**If the type of the value is not ubyte (was not created with amqpvalue_create_ubyte), then amqpvalue_get_ubyte shall return a non-zero value.**]**
155
156 ### amqpvalue_create_ushort
157
158 ```C
159 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_ushort, uint16_t, ushort_value);
160 ```
161
162 **SRS_AMQPVALUE_01_038: [**amqpvalue_create_ushort shall return a handle to an AMQP_VALUE that stores an uint16_t value.**]**
163 **SRS_AMQPVALUE_01_039: [**If allocating the AMQP_VALUE fails then amqpvalue_create_ushort shall return NULL.**]**
164
165 ### amqpvalue_get_ushort
166
167 ```C
168 MOCKABLE_FUNCTION(, int, amqpvalue_get_ushort, AMQP_VALUE, value, uint16_t*, ushort_value);
169 ```
170
171 **SRS_AMQPVALUE_01_040: [**amqpvalue_get_ushort shall fill in the ushort_value argument the uint16_t value stored by the AMQP value indicated by the value argument.**]**
172 **SRS_AMQPVALUE_01_041: [**On success amqpvalue_get_ushort shall return 0.**]**
173 **SRS_AMQPVALUE_01_042: [**If any of the arguments is NULL then amqpvalue_get_ushort shall return a non-zero value.**]**
174 **SRS_AMQPVALUE_01_043: [**If the type of the value is not ushort (was not created with amqpvalue_create_ushort), then amqpvalue_get_ushort shall return a non-zero value.**]**
175
176 ### amqpvalue_create_uint
177
178 ```C
179 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_uint, uint32_t, uint_value);
180 ```
181
182 **SRS_AMQPVALUE_01_044: [**amqpvalue_create_uint shall return a handle to an AMQP_VALUE that stores an uint32_t value.**]**
183 **SRS_AMQPVALUE_01_045: [**If allocating the AMQP_VALUE fails then amqpvalue_create_uint shall return NULL.**]**
184
185 ### amqpvalue_get_uint
186
187 ```C
188 MOCKABLE_FUNCTION(, int, amqpvalue_get_uint, AMQP_VALUE, value, uint32_t*, uint_value);
189 ```
190
191 **SRS_AMQPVALUE_01_046: [**amqpvalue_get_uint shall fill in the uint_value argument the uint32_t value stored by the AMQP value indicated by the value argument.**]**
192 **SRS_AMQPVALUE_01_047: [**On success amqpvalue_get_uint shall return 0.**]**
193 **SRS_AMQPVALUE_01_079: [**If any of the arguments is NULL then amqpvalue_get_uint shall return a non-zero value.**]**
194 **SRS_AMQPVALUE_01_048: [**If the type of the value is not uint (was not created with amqpvalue_create_uint), then amqpvalue_get_uint shall return a non-zero value.**]**
195
196 ### amqpvalue_create_ulong
197
198 ```C
199 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_ulong, uint64_t, ulong_value);
200 ```
201
202 **SRS_AMQPVALUE_01_049: [**amqpvalue_create_ulong shall return a handle to an AMQP_VALUE that stores an uint64_t value.**]**
203 **SRS_AMQPVALUE_01_050: [**If allocating the AMQP_VALUE fails then amqpvalue_create_ulong shall return NULL.**]**
204
205 ### amqpvalue_get_ulong
206
207 ```C
208 MOCKABLE_FUNCTION(, int, amqpvalue_get_ulong, AMQP_VALUE, value, uint64_t*, ulong_value);
209 ```
210
211 **SRS_AMQPVALUE_01_051: [**amqpvalue_get_ulong shall fill in the ulong_value argument the ulong64_t value stored by the AMQP value indicated by the value argument.**]**
212 **SRS_AMQPVALUE_01_052: [**On success amqpvalue_get_ulong shall return 0.**]**
213 **SRS_AMQPVALUE_01_053: [**If any of the arguments is NULL then amqpvalue_get_ulong shall return a non-zero value.**]**
214 **SRS_AMQPVALUE_01_054: [**If the type of the value is not ulong (was not created with amqpvalue_create_ulong), then amqpvalue_get_ulong shall return a non-zero value.**]**
215
216 ### amqpvalue_create_byte
217
218 ```C
219 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_byte, char, byte_value);
220 ```
221
222 **SRS_AMQPVALUE_01_055: [**amqpvalue_create_byte shall return a handle to an AMQP_VALUE that stores a char value.**]**
223 **SRS_AMQPVALUE_01_056: [**If allocating the AMQP_VALUE fails then amqpvalue_create_byte shall return NULL.**]**
224
225 ### amqpvalue_get_byte
226
227 ```C
228 MOCKABLE_FUNCTION(, int, amqpvalue_get_byte, AMQP_VALUE, value, char*, byte_value);
229 ```
230
231 **SRS_AMQPVALUE_01_057: [**amqpvalue_get_byte shall fill in the byte_value argument the char value stored by the AMQP value indicated by the value argument.**]**
232 **SRS_AMQPVALUE_01_058: [**On success amqpvalue_get_byte shall return 0.**]**
233 **SRS_AMQPVALUE_01_059: [**If any of the arguments is NULL then amqpvalue_get_byte shall return a non-zero value.**]**
234 **SRS_AMQPVALUE_01_060: [**If the type of the value is not byte (was not created with amqpvalue_create_byte), then amqpvalue_get_byte shall return a non-zero value.**]**
235
236 ### amqpvalue_create_short
237
238 ```C
239 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_short, int16_t, short_value);
240 ```
241
242 **SRS_AMQPVALUE_01_061: [**amqpvalue_create_short shall return a handle to an AMQP_VALUE that stores an int16_t value.**]**
243 **SRS_AMQPVALUE_01_062: [**If allocating the AMQP_VALUE fails then amqpvalue_create_short shall return NULL.**]**
244
245 ### amqpvalue_get_short
246
247 ```C
248 MOCKABLE_FUNCTION(, int, amqpvalue_get_short, AMQP_VALUE, value, int16_t*, short_value);
249 ```
250
251 **SRS_AMQPVALUE_01_063: [**amqpvalue_get_short shall fill in the short_value argument the int16_t value stored by the AMQP value indicated by the value argument.**]**
252 **SRS_AMQPVALUE_01_064: [**On success amqpvalue_get_short shall return 0.**]**
253 **SRS_AMQPVALUE_01_065: [**If any of the arguments is NULL then amqpvalue_get_short shall return a non-zero value.**]**
254 **SRS_AMQPVALUE_01_066: [**If the type of the value is not short (was not created with amqpvalue_create_short), then amqpvalue_get_short shall return a non-zero value.**]**
255
256 ### amqpvalue_create_int
257
258 ```C
259 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_int, int32_t, int_value);
260 ```
261
262 **SRS_AMQPVALUE_01_067: [**amqpvalue_create_int shall return a handle to an AMQP_VALUE that stores an int32_t value.**]**
263 **SRS_AMQPVALUE_01_068: [**If allocating the AMQP_VALUE fails then amqpvalue_create_int shall return NULL.**]**
264
265 ### amqpvalue_get_int
266
267 ```C
268 MOCKABLE_FUNCTION(, int, amqpvalue_get_int, AMQP_VALUE, value, int32_t*, int_value);
269 ```
270
271 **SRS_AMQPVALUE_01_069: [**amqpvalue_get_int shall fill in the int_value argument the int32_t value stored by the AMQP value indicated by the value argument.**]**
272 **SRS_AMQPVALUE_01_070: [**On success amqpvalue_get_int shall return 0.**]**
273 **SRS_AMQPVALUE_01_071: [**If any of the arguments is NULL then amqpvalue_get_int shall return a non-zero value.**]**
274 **SRS_AMQPVALUE_01_072: [**If the type of the value is not int (was not created with amqpvalue_create_int), then amqpvalue_get_int shall return a non-zero value.**]**
275
276 ### amqpvalue_create_long
277
278 ```C
279 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_long, int64_t, long_value);
280 ```
281
282 **SRS_AMQPVALUE_01_073: [**amqpvalue_create_long shall return a handle to an AMQP_VALUE that stores an int64_t value.**]**
283 **SRS_AMQPVALUE_01_074: [**If allocating the AMQP_VALUE fails then amqpvalue_create_long shall return NULL.**]**
284
285
286 ### amqpvalue_get_long
287
288 ```C
289 MOCKABLE_FUNCTION(, int, amqpvalue_get_long, AMQP_VALUE, value, int64_t*, long_value);
290 ```
291
292 **SRS_AMQPVALUE_01_075: [**amqpvalue_get_long shall fill in the long_value argument the int64_t value stored by the AMQP value indicated by the value argument.**]**
293 **SRS_AMQPVALUE_01_076: [**On success amqpvalue_get_long shall return 0.**]**
294 **SRS_AMQPVALUE_01_077: [**If any of the arguments is NULL then amqpvalue_get_long shall return a non-zero value.**]**
295 **SRS_AMQPVALUE_01_078: [**If the type of the value is not long (was not created with amqpvalue_create_long), then amqpvalue_get_long shall return a non-zero value.**]**
296
297 ### amqpvalue_create_float
298
299 ```C
300 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_float, float, float_value);
301 ```
302
303 **SRS_AMQPVALUE_01_080: [**amqpvalue_create_float shall return a handle to an AMQP_VALUE that stores a float value.**]**
304 **SRS_AMQPVALUE_01_081: [**If allocating the AMQP_VALUE fails then amqpvalue_create_float shall return NULL.**]**
305
306 ### amqpvalue_get_float
307
308 ```C
309 MOCKABLE_FUNCTION(, int, amqpvalue_get_float, AMQP_VALUE, value, float*, float_value);
310 ```
311
312 **SRS_AMQPVALUE_01_082: [**amqpvalue_get_float shall fill in the float_value argument the float value stored by the AMQP value indicated by the value argument.**]**
313 **SRS_AMQPVALUE_01_083: [**On success amqpvalue_get_float shall return 0.**]**
314 **SRS_AMQPVALUE_01_084: [**If any of the arguments is NULL then amqpvalue_get_float shall return a non-zero value.**]**
315 **SRS_AMQPVALUE_01_085: [**If the type of the value is not float (was not created with amqpvalue_create_float), then amqpvalue_get_float shall return a non-zero value.**]**
316
317 ### amqpvalue_create_double
318
319 ```C
320 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_double, double, double_value);
321 ```
322
323 **SRS_AMQPVALUE_01_086: [**amqpvalue_create_double shall return a handle to an AMQP_VALUE that stores a double value.**]**
324 **SRS_AMQPVALUE_01_087: [**If allocating the AMQP_VALUE fails then amqpvalue_create_double shall return NULL.**]**
325
326 ### amqpvalue_get_double
327
328 ```C
329 MOCKABLE_FUNCTION(, int, amqpvalue_get_double, AMQP_VALUE, value, double*, double_value);
330 ```
331
332 **SRS_AMQPVALUE_01_088: [**amqpvalue_get_double shall fill in the double_value argument the double value stored by the AMQP value indicated by the value argument.**]**
333 **SRS_AMQPVALUE_01_089: [**On success amqpvalue_get_double shall return 0.**]**
334 **SRS_AMQPVALUE_01_090: [**If any of the arguments is NULL then amqpvalue_get_double shall return a non-zero value.**]**
335 **SRS_AMQPVALUE_01_091: [**If the type of the value is not double (was not created with amqpvalue_create_double), then amqpvalue_get_double shall return a non-zero value.**]**
336
337 ### amqpvalue_create_char
338
339 ```C
340 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_char, uint32_t, char_value);
341 ```
342
343 **SRS_AMQPVALUE_01_092: [**amqpvalue_create_char shall return a handle to an AMQP_VALUE that stores a single UTF-32 character value.**]**
344 **SRS_AMQPVALUE_01_093: [**If allocating the AMQP_VALUE fails then amqpvalue_create_char shall return NULL.**]**
345 **SRS_AMQPVALUE_01_098: [**If the code point value is outside of the allowed range [0, 0x10FFFF**]** then amqpvalue_create_char shall return NULL.]
346
347 ### amqpvalue_get_char
348
349 ```C
350 MOCKABLE_FUNCTION(, int, amqpvalue_get_char, AMQP_VALUE, value, uint32_t*, char_value);
351 ```
352
353 **SRS_AMQPVALUE_01_094: [**amqpvalue_get_char shall fill in the char_value argument the UTF32 char value stored by the AMQP value indicated by the value argument.**]**
354 **SRS_AMQPVALUE_01_095: [**On success amqpvalue_get_char shall return 0.**]**
355 **SRS_AMQPVALUE_01_096: [**If any of the arguments is NULL then amqpvalue_get_char shall return a non-zero value.**]**
356 **SRS_AMQPVALUE_01_097: [**If the type of the value is not char (was not created with amqpvalue_create_char), then amqpvalue_get_char shall return a non-zero value.**]**
357
358 ### amqpvalue_create_timestamp
359
360 ```C
361 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_timestamp, int64_t, timestamp_value);
362 ```
363
364 **SRS_AMQPVALUE_01_107: [**amqpvalue_create_timestamp shall return a handle to an AMQP_VALUE that stores an uint64_t value that represents a millisecond precision Unix time.**]**
365 **SRS_AMQPVALUE_01_108: [**If allocating the AMQP_VALUE fails then amqpvalue_create_timestamp shall return NULL.**]**
366
367 ### amqpvalue_get_timestamp
368
369 ```C
370 MOCKABLE_FUNCTION(, int, amqpvalue_get_timestamp, AMQP_VALUE, value, int64_t*, timestamp_value);
371 ```
372
373 **SRS_AMQPVALUE_01_109: [**amqpvalue_get_timestamp shall fill in the timestamp_value argument the timestamp value stored by the AMQP value indicated by the value argument.**]**
374 **SRS_AMQPVALUE_01_110: [**On success amqpvalue_get_timestamp shall return 0.**]**
375 **SRS_AMQPVALUE_01_111: [**If any of the arguments is NULL then amqpvalue_get_timestamp shall return a non-zero value.**]**
376 **SRS_AMQPVALUE_01_112: [**If the type of the value is not timestamp (was not created with amqpvalue_create_timestamp), then amqpvalue_get_timestamp shall return a non-zero value.**]**
377
378 ### amqpvalue_create_uuid
379
380 ```C
381 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_uuid, uuid, uuid_value);
382 ```
383
384 **SRS_AMQPVALUE_01_113: [**amqpvalue_create_uuid shall return a handle to an AMQP_VALUE that stores an amqp_uuid value that represents a unique identifier per RFC-4122 section 4.1.2.**]**
385 **SRS_AMQPVALUE_01_114: [**If allocating the AMQP_VALUE fails then amqpvalue_create_uuid shall return NULL.**]**
386
387 ### amqpvalue_get_uuid
388
389 ```C
390 MOCKABLE_FUNCTION(, int, amqpvalue_get_uuid, AMQP_VALUE, value, uuid*, uuid_value);
391 ```
392
393 **SRS_AMQPVALUE_01_115: [**amqpvalue_get_uuid shall fill in the uuid_value argument the uuid value stored by the AMQP value indicated by the value argument.**]**
394 **SRS_AMQPVALUE_01_116: [**On success amqpvalue_get_uuid shall return 0.**]**
395 **SRS_AMQPVALUE_01_117: [**If any of the arguments is NULL then amqpvalue_get_uuid shall return a non-zero value.**]**
396 **SRS_AMQPVALUE_01_118: [**If the type of the value is not uuid (was not created with amqpvalue_create_uuid), then amqpvalue_get_uuid shall return a non-zero value.**]**
397
398 ### amqpvalue_create_binary
399
400 ```C
401 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_binary, amqp_binary, binary_value);
402 ```
403
404 **SRS_AMQPVALUE_01_127: [**amqpvalue_create_binary shall return a handle to an AMQP_VALUE that stores a sequence of bytes.**]**
405 **SRS_AMQPVALUE_01_128: [**If allocating the AMQP_VALUE fails then amqpvalue_create_binary shall return NULL.**]**
406 **SRS_AMQPVALUE_01_129: [**If value.data is NULL and value.length is positive then amqpvalue_create_binary shall return NULL.**]**
407 **SRS_AMQPVALUE_01_130: [**If any other error occurs, amqpvalue_create_binary shall return NULL.**]**
408
409 ### amqpvalue_get_binary
410
411 ```C
412 MOCKABLE_FUNCTION(, int, amqpvalue_get_binary, AMQP_VALUE, value, amqp_binary*, binary_value);
413 ```
414
415 **SRS_AMQPVALUE_01_131: [**amqpvalue_get_binary shall yield a pointer to the sequence of bytes held by the AMQP_VALUE in binary_value.data and fill in the binary_value.length argument the number of bytes held in the binary value.**]**
416 **SRS_AMQPVALUE_01_132: [**If any of the arguments is NULL then amqpvalue_get_binary shall return NULL.**]**
417 **SRS_AMQPVALUE_01_133: [**If the type of the value is not binary (was not created with amqpvalue_create_binary), then amqpvalue_get_binary shall return NULL.**]**
418
419 ### amqpvalue_create_string
420
421 ```C
422 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_string, const char*, string_value);
423 ```
424
425 **SRS_AMQPVALUE_01_135: [**amqpvalue_create_string shall return a handle to an AMQP_VALUE that stores a sequence of Unicode characters.**]**
426 **SRS_AMQPVALUE_01_136: [**If allocating the AMQP_VALUE fails then amqpvalue_create_string shall return NULL.**]**
427 **SRS_AMQPVALUE_01_137: [**If any other error occurs, amqpvalue_create_string shall return NULL.**]**
428
429 ### amqpvalue_get_string
430
431 ```C
432 MOCKABLE_FUNCTION(, int, amqpvalue_get_string, AMQP_VALUE, value, const char**, string_value);
433 ```
434
435 **SRS_AMQPVALUE_01_138: [**amqpvalue_get_string shall yield a pointer to the sequence of bytes held by the AMQP_VALUE in string_value.**]**
436 **SRS_AMQPVALUE_01_141: [**On success, amqpvalue_get_string shall return 0.**]**
437 **SRS_AMQPVALUE_01_139: [**If any of the arguments is NULL then amqpvalue_get_string shall return a non-zero value.**]**
438 **SRS_AMQPVALUE_01_140: [**If the type of the value is not string (was not created with amqpvalue_create_string), then amqpvalue_get_string shall return a non-zero value.**]**
439
440 ### amqpvalue_create_symbol
441
442 ```C
443 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_symbol, const char*, symbol_value);
444 ```
445
446 **SRS_AMQPVALUE_01_142: [**amqpvalue_create_symbol shall return a handle to an AMQP_VALUE that stores a symbol (ASCII string) value.**]**
447 **SRS_AMQPVALUE_01_400: [**If value is NULL, amqpvalue_create_symbol shall fail and return NULL.**]**
448 **SRS_AMQPVALUE_01_143: [**If allocating the AMQP_VALUE fails then amqpvalue_create_symbol shall return NULL.**]**
449 **SRS_AMQPVALUE_01_401: [** If the string pointed to by value is longer than 2^32-1 then amqpvalue_create_symbol shall return NULL. **]**
450
451 ### amqpvalue_get_symbol
452
453 ```C
454 MOCKABLE_FUNCTION(, int, amqpvalue_get_symbol, AMQP_VALUE, value, const char**, symbol_value);
455 ```
456
457 **SRS_AMQPVALUE_01_145: [**amqpvalue_get_symbol shall fill in the symbol_value the symbol value string held by the AMQP_VALUE.**]**
458 **SRS_AMQPVALUE_01_146: [**On success, amqpvalue_get_symbol shall return 0.**]**
459 **SRS_AMQPVALUE_01_147: [**If any of the arguments is NULL then amqpvalue_get_symbol shall return a non-zero value.**]**
460 **SRS_AMQPVALUE_01_148: [**If the type of the value is not symbol (was not created with amqpvalue_create_symbol), then amqpvalue_get_symbol shall return a non-zero value.**]**
461
462 ### amqpvalue_create_list
463
464 ```C
465 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_list);
466 ```
467
468 **SRS_AMQPVALUE_01_149: [**amqpvalue_create_list shall return a handle to an AMQP_VALUE that stores a list.**]**
469 **SRS_AMQPVALUE_01_150: [**If allocating the AMQP_VALUE fails then amqpvalue_create_list shall return NULL.**]**
470 **SRS_AMQPVALUE_01_151: [**The list shall have an initial size of zero.**]**
471
472 ### amqpvalue_set_list_item_count
473
474 ```C
475 MOCKABLE_FUNCTION(, int, amqpvalue_set_list_item_count, AMQP_VALUE, list, uint32_t, count);
476 ```
477
478 **SRS_AMQPVALUE_01_152: [**amqpvalue_set_list_item_count shall resize an AMQP list.**]**
479 **SRS_AMQPVALUE_01_153: [**On success amqpvalue_set_list_item_count shall return 0.**]**
480 **SRS_AMQPVALUE_01_155: [**If the value argument is NULL, amqpvalue_set_list_item_count shall return a non-zero value.**]**
481 **SRS_AMQPVALUE_01_154: [**If allocating memory for the list according to the new size fails, then amqpvalue_set_list_item_count shall return a non-zero value, while preserving the existing list contents.**]**
482 **SRS_AMQPVALUE_01_156: [**If the value is not of type list, then amqpvalue_set_list_item_count shall return a non-zero value.**]**
483 **SRS_AMQPVALUE_01_161: [**When the list is shrunk, the extra items shall be freed by using amqp_value_destroy.**]**
484 **SRS_AMQPVALUE_01_162: [**When a list is grown a null AMQP_VALUE shall be inserted as new list items to fill the list up to the new size.**]**
485
486 ### amqpvalue_get_list_item_count
487
488 ```C
489 MOCKABLE_FUNCTION(, int, amqpvalue_get_list_item_count, AMQP_VALUE, list, uint32_t*, count);
490 ```
491
492 **SRS_AMQPVALUE_01_157: [**amqpvalue_get_list_item_count shall fill in the size argument the number of items held by the AMQP list.**]**
493 **SRS_AMQPVALUE_01_158: [**On success amqpvalue_get_list_item_count shall return 0.**]**
494 **SRS_AMQPVALUE_01_159: [**If any of the arguments are NULL, amqpvalue_get_list_item_count shall return a non-zero value.**]**
495 **SRS_AMQPVALUE_01_160: [**If the AMQP_VALUE is not a list then amqpvalue_get_list_item_count shall return a non-zero value.**]**
496
497 ### amqpvalue_set_list_item
498
499 ```C
500 MOCKABLE_FUNCTION(, int, amqpvalue_set_list_item, AMQP_VALUE, list, uint32_t, index, AMQP_VALUE, list_item_value);
501 ```
502
503 **SRS_AMQPVALUE_01_163: [**amqpvalue_set_list_item shall replace the item at the 0 based index-th position in the list identified by the value argument with the AMQP_VALUE specified by list_item_value.**]**
504 **SRS_AMQPVALUE_01_164: [**On success amqpvalue_set_list_item shall return 0.**]**
505 **SRS_AMQPVALUE_01_165: [**If value or list_item_value is NULL, amqpvalue_set_list_item shall fail and return a non-zero value.**]**
506 **SRS_AMQPVALUE_01_166: [**If index is greater than the current list item count, the list shall be grown to accommodate the new item.**]**
507 **SRS_AMQPVALUE_01_172: [**If growing the list fails, then amqpvalue_set_list_item shall fail and return a non-zero value.**]**
508 **SRS_AMQPVALUE_01_167: [**Any previous value stored at the position index in the list shall be freed by using amqpvalue_destroy.**]**
509 **SRS_AMQPVALUE_01_168: [**The item stored at the index-th position in the list shall be a clone of list_item_value.**]**
510 **SRS_AMQPVALUE_01_169: [**If cloning the item fails, amqpvalue_set_list_item shall fail and return a non-zero value.**]**
511 **SRS_AMQPVALUE_01_170: [**When amqpvalue_set_list_item fails due to not being able to clone the item or grow the list, the list shall not be altered.**]**
512 **SRS_AMQPVALUE_01_171: [**If the list_item_value_would result in a list with an encoding that would exceed the ISO limits, amqpvalue_set_list_item shall fail and return a non-zero value.**]**
513
514 ### amqpvalue_get_list_item
515
516 ```C
517 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_get_list_item, AMQP_VALUE, list, size_t, index);
518 ```
519
520 **SRS_AMQPVALUE_01_173: [**amqpvalue_get_list_item shall return a copy of the AMQP_VALUE stored at the 0 based position index in the list identified by value.**]**
521 **SRS_AMQPVALUE_01_174: [**If the value argument is NULL, amqpvalue_get_list_item shall fail and return NULL.**]**
522 **SRS_AMQPVALUE_01_175: [**If index is greater or equal to the number of items in the list then amqpvalue_get_list_item shall fail and return NULL.**]**
523 **SRS_AMQPVALUE_01_176: [**If cloning the item at position index fails, then amqpvalue_get_list_item shall fail and return NULL.**]**
524 **SRS_AMQPVALUE_01_177: [**If value is not a list then amqpvalue_get_list_item shall fail and return NULL.**]**
525
526 ### amqpvalue_create_map
527
528 ```C
529 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_map);
530 ```
531
532 **SRS_AMQPVALUE_01_178: [**amqpvalue_create_map shall create an AMQP value that holds a map and return a handle to it.**]**
533 **SRS_AMQPVALUE_01_179: [**If allocating memory for the map fails, then amqpvalue_create_map shall return NULL.**]**
534 **SRS_AMQPVALUE_01_180: [**The number of key/value pairs in the newly created map shall be zero.**]**
535
536 ### amqpvalue_set_map_value
537
538 ```C
539 MOCKABLE_FUNCTION(, int, amqpvalue_set_map_value, AMQP_VALUE, map, AMQP_VALUE, key, AMQP_VALUE, value);
540 ```
541
542 **SRS_AMQPVALUE_01_181: [**amqpvalue_set_map_value shall set the value in the map identified by the map argument for a key/value pair identified by the key argument.**]**
543 **SRS_AMQPVALUE_01_182: [**On success amqpvalue_set_map_value shall return 0.**]**
544 **SRS_AMQPVALUE_01_183: [**If any of the arguments are NULL, amqpvalue_set_map_value shall fail and return a non-zero value.**]**
545 **SRS_AMQPVALUE_01_184: [**If the key already exists in the map, its value shall be replaced with the value provided by the value argument.**]**
546 **SRS_AMQPVALUE_01_185: [**When storing the key or value, their contents shall be cloned.**]**
547 **SRS_AMQPVALUE_01_186: [**If allocating memory to hold a new key/value pair fails, amqpvalue_set_map_value shall fail and return a non-zero value.**]**
548 **SRS_AMQPVALUE_01_187: [**If cloning the key fails, amqpvalue_set_map_value shall fail and return a non-zero value.**]**
549 **SRS_AMQPVALUE_01_188: [**If cloning the value fails, amqpvalue_set_map_value shall fail and return a non-zero value.**]**
550 **SRS_AMQPVALUE_01_196: [**If the map argument is not an AMQP value created with the amqpvalue_create_map function than amqpvalue_set_map_value shall fail and return a non-zero value.**]**
551
552 ### amqpvalue_get_map_value
553
554 ```C
555 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_get_map_value, AMQP_VALUE, map, AMQP_VALUE, key);
556 ```
557
558 **SRS_AMQPVALUE_01_189: [**amqpvalue_get_map_value shall return the value whose key is identified by the key argument.**]**
559 **SRS_AMQPVALUE_01_192: [**The returned value shall be a clone of the actual value stored in the map.**]**
560 **SRS_AMQPVALUE_01_190: [**If any argument is NULL, amqpvalue_get_map_value shall return NULL.**]**
561 **SRS_AMQPVALUE_01_191: [**If the key cannot be found, amqpvalue_get_map_value shall return NULL.**]**
562 **SRS_AMQPVALUE_01_197: [**If the map argument is not an AMQP value created with the amqpvalue_create_map function than amqpvalue_get_map_value shall return NULL.**]**
563
564 ### amqpvalue_get_map_pair_count
565
566 ```C
567 MOCKABLE_FUNCTION(, int, amqpvalue_get_map_pair_count, AMQP_VALUE, map, uint32_t*, pair_count);
568 ```
569
570 **SRS_AMQPVALUE_01_193: [**amqpvalue_get_map_pair_count shall fill in the number of key/value pairs in the map in the pair_count argument.**]**
571 **SRS_AMQPVALUE_01_194: [**On success amqpvalue_get_map_pair_count shall return 0.**]**
572 **SRS_AMQPVALUE_01_195: [**If any of the arguments is NULL, amqpvalue_get_map_pair_count shall fail and return a non-zero value.**]**
573 **SRS_AMQPVALUE_01_198: [**If the map argument is not an AMQP value created with the amqpvalue_create_map function then amqpvalue_get_map_pair_count shall fail and return a non-zero value.**]**
574
575 ### amqpvalue_get_map_key_value_pair
576
577 ```C
578 MOCKABLE_FUNCTION(, int, amqpvalue_get_map_key_value_pair, AMQP_VALUE, map, uint32_t, index, AMQP_VALUE*, key, AMQP_VALUE*, value);
579 ```
580
581 **SRS_AMQPVALUE_01_199: [**amqpvalue_get_map_key_value_pair shall fill in the key and value arguments copies of the key/value pair on the 0 based position index in a map.**]**
582 **SRS_AMQPVALUE_01_200: [**On success amqpvalue_get_map_key_value_pair shall return 0.**]**
583 **SRS_AMQPVALUE_01_201: [**If any of the map, key or value arguments is NULL, amqpvalue_get_map_key_value_pair shall fail and return a non-zero value.**]**
584 **SRS_AMQPVALUE_01_202: [**If cloning the key fails, amqpvalue_get_map_key_value_pair shall fail and return a non-zero value.**]**
585 **SRS_AMQPVALUE_01_203: [**If cloning the value fails, amqpvalue_get_map_key_value_pair shall fail and return a non-zero value.**]**
586 **SRS_AMQPVALUE_01_204: [**If the index argument is greater or equal to the number of key/value pairs in the map then amqpvalue_get_map_key_value_pair shall fail and return a non-zero value.**]**
587 **SRS_AMQPVALUE_01_205: [**If the map argument is not an AMQP value created with the amqpvalue_create_map function then amqpvalue_get_map_key_value_pair shall fail and return a non-zero value.**]**
588
589 ### amqpvalue_get_map
590
591 ```c
592 MOCKABLE_FUNCTION(, int, amqpvalue_get_map, AMQP_VALUE, from_value, AMQP_VALUE*, map);
593 ```
594
595 TBD
596
597 ### amqpvalue_create_array
598
599 ```C
600 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_create_array);
601 ```
602
603 **SRS_AMQPVALUE_01_404: [** `amqpvalue_create_array` shall return a handle to an AMQP_VALUE that stores an array. **]**
604 **SRS_AMQPVALUE_01_405: [** If allocating memory for the array fails, then `amqpvalue_create_array` shall return NULL. **]**
605 **SRS_AMQPVALUE_01_406: [** The array shall have an initial size of zero. **]**
606
607 ### amqpvalue_add_array_item
608
609 ```C
610 MOCKABLE_FUNCTION(, int, amqpvalue_add_array_item, AMQP_VALUE, value, AMQP_VALUE, array_item_value);
611 ```
612
613 **SRS_AMQPVALUE_01_407: [** `amqpvalue_add_array_item` shall add the AMQP_VALUE specified by `array_item_value` at the 0 based n-th position in the array. **]**
614 **SRS_AMQPVALUE_01_408: [** On success `amqpvalue_add_array_item` shall return 0. **]**
615 **SRS_AMQPVALUE_01_424: [** If growing the array fails, then `amqpvalue_add_array_item` shall fail and return a non-zero value. **]**
616 **SRS_AMQPVALUE_01_409: [** If `value` or `array_item_value` is NULL, amqpvalue_add_array_item shall fail and return a non-zero value. **]**
617 **SRS_AMQPVALUE_01_410: [** The item stored at the n-th position in the array shall be a clone of `array_item_value`. **]**
618 **SRS_AMQPVALUE_01_412: [** If cloning the item fails, `amqpvalue_add_array_item` shall fail and return a non-zero value. **]**
619 **SRS_AMQPVALUE_01_423: [** When `amqpvalue_add_array_item` fails due to not being able to clone the item or grow the array, the array shall not be altered. **]**
620 **SRS_AMQPVALUE_01_413: [** If the `value` argument is not an AMQP array created with the `amqpvalue_create_array` function than `amqpvalue_add_array_item` shall fail and return a non-zero value. **]**
621 **SRS_AMQPVALUE_01_425: [** If the type of `array_item_value` does not match that of items already in the array then `amqpvalue_add_array_item` shall fail and return a non-zero value. **]**
622
623 ### amqpvalue_get_array_item
624
625 ```C
626 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_get_array_item, AMQP_VALUE, value, uint32_t, index);
627 ```
628
629 **SRS_AMQPVALUE_01_414: [** `amqpvalue_get_array_item` shall return a copy of the AMQP_VALUE stored at the 0 based position `index` in the array identified by `value`. **]**
630 **SRS_AMQPVALUE_01_416: [** If the `value` argument is NULL, `amqpvalue_get_array_item` shall fail and return NULL. **]**
631 **SRS_AMQPVALUE_01_417: [** If `index` is greater or equal to the number of items in the array then `amqpvalue_get_array_item` shall fail and return NULL. **]**
632 **SRS_AMQPVALUE_01_418: [** If value is not an array then `amqpvalue_get_array_item` shall fail and return NULL. **]**
633 **SRS_AMQPVALUE_01_426: [** If cloning the item at position `index` fails, then `amqpvalue_get_array_item` shall fail and return NULL. **]**
634
635 ### amqpvalue_get_array_item_count
636
637 ```C
638 MOCKABLE_FUNCTION(, int, amqpvalue_get_array_item_count, AMQP_VALUE, value, uint32_t*, count);
639 ```
640
641 **SRS_AMQPVALUE_01_419: [** `amqpvalue_get_array_item_count` shall return in `count` the number of items in the array. **]**
642 **SRS_AMQPVALUE_01_420: [** On success `amqpvalue_get_array_item_count` shall return 0. **]**
643 **SRS_AMQPVALUE_01_421: [** If any of the arguments is NULL, `amqpvalue_get_array_item_count` shall fail and return a non-zero value. **]**
644 **SRS_AMQPVALUE_01_422: [** If the array argument is not an AMQP value created with the `amqpvalue_create_array` function then `amqpvalue_get_array_item_count` shall fail and return a non-zero value. **]**
645
646 ### amqpvalue_get_array
647
648 ```c
649 MOCKABLE_FUNCTION(, int, amqpvalue_get_array, AMQP_VALUE, value, AMQP_VALUE*, array_value);
650 ```
651
652 TBD
653
654 ### amqpvalue_destroy
655
656 ```C
657 MOCKABLE_FUNCTION(, void, amqpvalue_destroy, AMQP_VALUE, value);
658 ```
659
660 **SRS_AMQPVALUE_01_314: [**amqpvalue_destroy shall free all resources allocated by any of the amqpvalue_create_xxx functions or amqpvalue_clone.**]**
661 **SRS_AMQPVALUE_01_315: [**If the value argument is NULL, amqpvalue_destroy shall do nothing.**]**
662
663 ### amqpvalue_are_equal
664
665 ```C
666 MOCKABLE_FUNCTION(, bool, amqpvalue_are_equal, AMQP_VALUE, value1, AMQP_VALUE, value2);
667 ```
668
669 **SRS_AMQPVALUE_01_206: [**amqpvalue_are_equal shall return true if the contents of value1 and value2 are equal.**]**
670 **SRS_AMQPVALUE_01_207: [**If value1 and value2 are NULL, amqpvalue_are_equal shall return true.**]**
671 **SRS_AMQPVALUE_01_208: [**If one of the arguments is NULL and the other is not, amqpvalue_are_equal shall return false.**]**
672 **SRS_AMQPVALUE_01_209: [**If the types for value1 and value2 are different amqpvalue_are_equal shall return false.**]**
673
674 For each type the contents shall be compared according to the types defined in the ISO:
675 **SRS_AMQPVALUE_01_210: [**- null: always equal.**]**
676 **SRS_AMQPVALUE_01_211: [**- boolean: compare the bool content.**]**
677 **SRS_AMQPVALUE_01_212: [**- ubyte: compare the unsigned char content.**]**
678 **SRS_AMQPVALUE_01_213: [**- ushort: compare the uint16_t content.**]**
679 **SRS_AMQPVALUE_01_214: [**- uint: compare the uint32_t content.**]**
680 **SRS_AMQPVALUE_01_215: [**- ulong: compare the uint64_t content.**]**
681 **SRS_AMQPVALUE_01_216: [**- byte: compare the char content.**]**
682 **SRS_AMQPVALUE_01_217: [**- short: compare the int16_t content.**]**
683 **SRS_AMQPVALUE_01_218: [**- int: compare the int32_t content.**]**
684 **SRS_AMQPVALUE_01_219: [**- long: compare the int64_t content.**]**
685 **SRS_AMQPVALUE_01_224: [**- float: compare the float content.**]**
686 **SRS_AMQPVALUE_01_225: [**- double: compare the double content.**]**
687 **SRS_AMQPVALUE_01_260: [**- decimal32: TBD.**]**
688 **SRS_AMQPVALUE_01_261: [**- decimal64: TBD.**]**
689 **SRS_AMQPVALUE_01_262: [**- decimal128: TBD.**]**
690 **SRS_AMQPVALUE_01_226: [**- char: compare the UNICODE character.**]**
691 **SRS_AMQPVALUE_01_227: [**- timestamp: compare the underlying 64 bit integer.**]**
692 **SRS_AMQPVALUE_01_228: [**- uuid: compare all uuid bytes.**]**
693 **SRS_AMQPVALUE_01_229: [**- binary: compare all binary bytes.**]**
694 **SRS_AMQPVALUE_01_230: [**- string: compare all string characters.**]**
695 **SRS_AMQPVALUE_01_263: [**- symbol: compare all symbol characters.**]**
696 **SRS_AMQPVALUE_01_231: [**- list: compare list item count and each element.**]** **SRS_AMQPVALUE_01_232: [**Nesting shall be considered in comparison.**]**
697 **SRS_AMQPVALUE_01_427: [**- array: compare array item count and each element. **]** **SRS_AMQPVALUE_01_428: [** Nesting shall be considered in comparison. **]**
698 **SRS_AMQPVALUE_01_233: [**- map: compare map pair count and each key/value pair.**]** **SRS_AMQPVALUE_01_234: [**Nesting shall be considered in comparison.**]**
699
700 ### amqpvalue_clone
701
702 ```C
703 MOCKABLE_FUNCTION(, AMQP_VALUE, amqpvalue_clone, AMQP_VALUE, value);
704 ```
705
706 **SRS_AMQPVALUE_01_235: [**amqpvalue_clone shall clone the value passed as argument and return a new non-NULL handle to the cloned AMQP value.**]**
707 **SRS_AMQPVALUE_01_402: [** If `value` is NULL, `amqpvalue_clone` shall return NULL. **]**
708 **SRS_AMQPVALUE_01_403: [** Cloning should be done by reference counting. **]**
709
710 All ISO types shall be supported:
711 - **SRS_AMQPVALUE_01_237: [**null**]**
712 - **SRS_AMQPVALUE_01_238: [**boolean**]**
713 - **SRS_AMQPVALUE_01_239: [**ubyte**]**
714 - **SRS_AMQPVALUE_01_240: [**ushort**]**
715 - **SRS_AMQPVALUE_01_241: [**uint**]**
716 - **SRS_AMQPVALUE_01_242: [**ulong**]**
717 - **SRS_AMQPVALUE_01_243: [**byte**]**
718 - **SRS_AMQPVALUE_01_244: [**short**]**
719 - **SRS_AMQPVALUE_01_245: [**int**]**
720 - **SRS_AMQPVALUE_01_246: [**long**]**
721 - **SRS_AMQPVALUE_01_247: [**float**]**
722 - **SRS_AMQPVALUE_01_248: [**double**]**
723 - **SRS_AMQPVALUE_01_249: [**decimal32**]**
724 - **SRS_AMQPVALUE_01_250: [**decimal64**]**
725 - **SRS_AMQPVALUE_01_251: [**decimal128**]**
726 - **SRS_AMQPVALUE_01_252: [**char**]**
727 - **SRS_AMQPVALUE_01_253: [**timestamp**]**
728 - **SRS_AMQPVALUE_01_254: [**uuid**]**
729 - **SRS_AMQPVALUE_01_255: [**binary**]**
730 - **SRS_AMQPVALUE_01_256: [**string**]**
731 - **SRS_AMQPVALUE_01_257: [**symbol**]**
732 - **SRS_AMQPVALUE_01_258: [**list**]**
733 - **SRS_AMQPVALUE_01_259: [**map**]**
734
735 ### amqpvalue_encode
736
737 ```C
738 MOCKABLE_FUNCTION(, int, amqpvalue_encode, AMQP_VALUE, value, AMQPVALUE_ENCODER_OUTPUT, encoder_output, void*, context);
739 ```
740
741 **SRS_AMQPVALUE_01_265: [**amqpvalue_encode shall encode the value per the ISO.**]**
742 **SRS_AMQPVALUE_01_266: [**On success amqpvalue_encode shall return 0.**]**
743 **SRS_AMQPVALUE_01_267: [**amqpvalue_encode shall pass the encoded bytes to the encoder_output function.**]**
744 **SRS_AMQPVALUE_01_268: [**On each call to the encoder_output function, amqpvalue_encode shall also pass the context argument.**]**
745 **SRS_AMQPVALUE_01_269: [**If value or encoder_output are NULL, amqpvalue_encode shall fail and return a non-zero value.**]**
746 **SRS_AMQPVALUE_01_274: [**When the encoder output function fails, amqpvalue_encode shall fail and return a non-zero value.**]**
747 **SRS_AMQPVALUE_01_271: [**If encoding fails due to any error not specifically mentioned here, it shall return a non-zero value.**]**
748
749 ### amqpvalue_get_encoded_size
750
751 ```C
752 MOCKABLE_FUNCTION(, int, amqpvalue_get_encoded_size, AMQP_VALUE, value, size_t*, encoded_size);
753 ```
754
755 **SRS_AMQPVALUE_01_308: [**amqpvalue_get_encoded_size shall fill in the encoded_size argument the number of bytes required to encode the given AMQP value.**]**
756 **SRS_AMQPVALUE_01_309: [**If any argument is NULL, amqpvalue_get_encoded_size shall return a non-zero value.**]**
757
758 ### amqpvalue_decoder_create
759
760 ```C
761 MOCKABLE_FUNCTION(, AMQPVALUE_DECODER_HANDLE, amqpvalue_decoder_create, ON_VALUE_DECODED, on_value_decoded, void*, callback_context);
762 ```
763
764 **SRS_AMQPVALUE_01_311: [**amqpvalue_decoder_create shall create a new amqp value decoder and return a non-NULL handle to it.**]**
765 **SRS_AMQPVALUE_01_312: [**If the on_value_decoded argument is NULL, amqpvalue_decoder_create shall return NULL.**]**
766 **SRS_AMQPVALUE_01_313: [**If creating the decoder fails, amqpvalue_decoder_create shall return NULL.**]**
767
768 ### amqpvalue_decoder_destroy
769
770 ```C
771 MOCKABLE_FUNCTION(, void, amqpvalue_decoder_destroy, AMQPVALUE_DECODER_HANDLE, handle);
772 ```
773
774 **SRS_AMQPVALUE_01_316: [**amqpvalue_decoder_destroy shall free all resources associated with the amqpvalue_decoder.**]**
775 **SRS_AMQPVALUE_01_317: [**If handle is NULL, amqpvalue_decoder_destroy shall do nothing.**]**
776
777 ### amqpvalue_decode_bytes
778
779 ```C
780 MOCKABLE_FUNCTION(, int, amqpvalue_decode_bytes, AMQPVALUE_DECODER_HANDLE, handle, const unsigned char*, buffer, size_t, size);
781 ```
782
783 **SRS_AMQPVALUE_01_318: [**amqpvalue_decode_bytes shall decode size bytes that are passed in the buffer argument.**]**
784 **SRS_AMQPVALUE_01_319: [**On success, amqpvalue_decode_bytes shall return 0.**]**
785 **SRS_AMQPVALUE_01_320: [**If handle or buffer are NULL, amqpvalue_decode_bytes shall return a non-zero value.**]**
786 **SRS_AMQPVALUE_01_321: [**If size is 0, amqpvalue_decode_bytes shall return a non-zero value.**]**
787 **SRS_AMQPVALUE_01_322: [**amqpvalue_decode_bytes shall process the bytes byte by byte, as a stream.**]**
788 **SRS_AMQPVALUE_01_323: [**When enough bytes have been processed for a valid amqp value, the on_value_decoded passed in amqpvalue_decoder_create shall be called.**]**
789 **SRS_AMQPVALUE_01_324: [**The decoded amqp value shall be passed to on_value_decoded.**]**
790 **SRS_AMQPVALUE_01_325: [**Also the context stored in amqpvalue_decoder_create shall be passed to the on_value_decoded callback.**]**
791 **SRS_AMQPVALUE_01_326: [**If any allocation failure occurs during decoding, amqpvalue_decode_bytes shall fail and return a non-zero value.**]**
792 **SRS_AMQPVALUE_01_327: [**If not enough bytes have accumulated to decode a value, the on_value_decoded shall not be called.**]**
793
794 ### Encoding ISO section
795
796 Primitive Type Definitions
797
798 **SRS_AMQPVALUE_01_003: [**1.6.1 null Indicates an empty value.**]**
799
800 \<type name="null" class="primitive">
801
802 **SRS_AMQPVALUE_01_264: [**\<encoding code="0x40" category="fixed" width="0" label="the null value"/>**]**
803
804 \</type>
805
806 **SRS_AMQPVALUE_01_004: [**1.6.2 boolean Represents a true or false value.**]**
807
808 \<type name="boolean" class="primitive">
809
810 **SRS_AMQPVALUE_01_270: [**\<encoding code="0x56" category="fixed" width="1" label="boolean with the octet 0x00 being false and octet 0x01 being true"/>**]**
811
812 **SRS_AMQPVALUE_01_272: [**\<encoding name="true" code="0x41" category="fixed" width="0" label="the boolean value true"/>**]**
813
814 **SRS_AMQPVALUE_01_273: [**\<encoding name="false" code="0x42" category="fixed" width="0" label="the boolean value false"/>**]**
815
816 </type>
817
818 **SRS_AMQPVALUE_01_005: [**1.6.3 ubyte Integer in the range 0 to 28 - 1 inclusive.**]**
819
820 \<type name="ubyte" class="primitive">
821
822 **SRS_AMQPVALUE_01_275: [**\<encoding code="0x50" category="fixed" width="1" label="8-bit unsigned integer"/>**]**
823
824 </type>
825
826 **SRS_AMQPVALUE_01_012: [**1.6.4 ushort Integer in the range 0 to 216 - 1 inclusive.**]**
827
828 \<type name="ushort" class="primitive">
829
830 **SRS_AMQPVALUE_01_276: [**\<encoding code="0x60" category="fixed" width="2" label="16-bit unsigned integer in network byte order"/>**]**
831
832 </type>
833
834 **SRS_AMQPVALUE_01_013: [**1.6.5 uint Integer in the range 0 to 232 - 1 inclusive.**]**
835
836 \<type name="uint" class="primitive">
837
838 **SRS_AMQPVALUE_01_277: [**\<encoding code="0x70" category="fixed" width="4" label="32-bit unsigned integer in network byte order"/>**]**
839
840 **SRS_AMQPVALUE_01_278: [**\<encoding name="smalluint" code="0x52" category="fixed" width="1" label="unsigned integer value in the range 0 to 255 inclusive"/>**]**
841
842 **SRS_AMQPVALUE_01_279: [**\<encoding name="uint0" code="0x43" category="fixed" width="0" label="the uint value 0"/>**]**
843
844 </type>
845
846 **SRS_AMQPVALUE_01_014: [**1.6.6 ulong Integer in the range 0 to 264 - 1 inclusive.**]**
847
848 \<type name="ulong" class="primitive">
849
850 **SRS_AMQPVALUE_01_280: [**\<encoding code="0x80" category="fixed" width="8" label="64-bit unsigned integer in network byte order"/>**]**
851
852 **SRS_AMQPVALUE_01_281: [**\<encoding name="smallulong" code="0x53" category="fixed" width="1" label="unsigned long value in the range 0 to 255 inclusive"/>**]**
853
854 **SRS_AMQPVALUE_01_282: [**\<encoding name="ulong0" code="0x44" category="fixed" width="0" label="the ulong value 0"/>**]**
855
856 </type>
857
858 **SRS_AMQPVALUE_01_015: [**1.6.7 byte Integer in the range -(27) to 27 - 1 inclusive.**]**
859
860 \<type name="byte" class="primitive">
861
862 **SRS_AMQPVALUE_01_283: [**\<encoding code="0x51" category="fixed" width="1" label="8-bit two's-complement integer"/>**]**
863
864 </type>
865
866 **SRS_AMQPVALUE_01_016: [**1.6.8 short Integer in the range -(215) to 215 - 1 inclusive.**]**
867
868 \<type name="short" class="primitive">
869
870 **SRS_AMQPVALUE_01_284: [**\<encoding code="0x61" category="fixed" width="2" label="16-bit two's-complement integer in network byte order"/>**]**
871
872 </type>
873
874 **SRS_AMQPVALUE_01_017: [**1.6.9 int Integer in the range -(231) to 231 - 1 inclusive.**]**
875
876 \<type name="int" class="primitive">
877
878 **SRS_AMQPVALUE_01_285: [**\<encoding code="0x71" category="fixed" width="4" label="32-bit two's-complement integer in network byte order"/>**]**
879
880 **SRS_AMQPVALUE_01_286: [**\<encoding name="smallint" code="0x54" category="fixed" width="1" label="8-bit two's-complement integer"/>**]**
881
882 </type>
883
884 **SRS_AMQPVALUE_01_018: [**1.6.10 long Integer in the range -(263) to 263 - 1 inclusive.**]**
885
886 \<type name="long" class="primitive">
887
888 **SRS_AMQPVALUE_01_287: [**\<encoding code="0x81" category="fixed" width="8" label="64-bit two's-complement integer in network byte order"/>**]**
889
890 **SRS_AMQPVALUE_01_288: [**\<encoding name="smalllong" code="0x55" category="fixed" width="1" label="8-bit two's-complement integer"/>**]**
891
892 </type>
893
894 **SRS_AMQPVALUE_01_019: [**1.6.11 float 32-bit floating point number (IEEE 754-2008 binary32).**]**
895
896 \<type name="float" class="primitive">
897
898 **SRS_AMQPVALUE_01_289: [**\<encoding name="ieee-754" code="0x72" category="fixed" width="4" label="IEEE 754-2008 binary32"/>**]**
899
900 </type>
901
902 **SRS_AMQPVALUE_01_106: [**A 32-bit floating point number (IEEE 754-2008 binary32 [IEEE754**]**).]
903
904 **SRS_AMQPVALUE_01_020: [**1.6.12 double 64-bit floating point number (IEEE 754-2008 binary64).**]**
905
906 \<type name="double" class="primitive">
907
908 **SRS_AMQPVALUE_01_290: [**\<encoding name="ieee-754" code="0x82" category="fixed" width="8" label="IEEE 754-2008 binary64"/>**]**
909
910 </type>
911
912 **SRS_AMQPVALUE_01_105: [**A 64-bit floating point number (IEEE 754-2008 binary64 [IEEE754**]**).]
913
914 **SRS_AMQPVALUE_01_021: [**1.6.13 decimal32 32-bit decimal number (IEEE 754-2008 decimal32).**]**
915
916 \<type name="decimal32" class="primitive">
917
918 **SRS_AMQPVALUE_01_291: [**\<encoding name="ieee-754" code="0x74" category="fixed" width="4" label="IEEE 754-2008 decimal32 using the Binary Integer Decimal encoding"/>**]**
919
920 </type>
921
922 **SRS_AMQPVALUE_01_104: [**A 32-bit decimal number (IEEE 754-2008 decimal32 [IEEE754**]**).]
923
924 **SRS_AMQPVALUE_01_022: [**1.6.14 decimal64 64-bit decimal number (IEEE 754-2008 decimal64).**]**
925
926 \<type name="decimal64" class="primitive">
927
928 **SRS_AMQPVALUE_01_292: [**\<encoding name="ieee-754" code="0x84" category="fixed" width="8" label="IEEE 754-2008 decimal64 using the Binary Integer Decimal encoding"/>**]**
929
930 </type>
931
932 **SRS_AMQPVALUE_01_103: [**A 64-bit decimal number (IEEE 754-2008 decimal64 [IEEE754**]**).]
933
934 **SRS_AMQPVALUE_01_023: [**1.6.15 decimal128 128-bit decimal number (IEEE 754-2008 decimal128).**]**
935
936 \<type name="decimal128" class="primitive">
937
938 **SRS_AMQPVALUE_01_293: [**\<encoding name="ieee-754" code="0x94" category="fixed" width="16" label="IEEE 754-2008 decimal128 using the Binary Integer Decimal encoding"/>**]**
939
940 </type>
941
942 **SRS_AMQPVALUE_01_102: [**A 128-bit decimal number (IEEE 754-2008 decimal128 [IEEE754**]**).]
943
944 **SRS_AMQPVALUE_01_024: [**1.6.16 char A single Unicode character.**]**
945
946 \<type name="char" class="primitive">
947
948 **SRS_AMQPVALUE_01_294: [**\<encoding name="utf32" code="0x73" category="fixed" width="4" label="a UTF-32BE encoded Unicode character"/>**]**
949
950 </type>
951
952 **SRS_AMQPVALUE_01_101: [**A UTF-32BE encoded Unicode character [UNICODE6**]**.]
953
954 **SRS_AMQPVALUE_01_025: [**1.6.17 timestamp An absolute point in time.**]**
955
956 \<type name="timestamp" class="primitive">
957
958 **SRS_AMQPVALUE_01_295: [**\<encoding name="ms64" code="0x83" category="fixed" width="8" label="64-bit two's-complement integer representing milliseconds since the unix epoch"/>**]**
959
960 </type>
961
962 **SRS_AMQPVALUE_01_099: [**Represents an approximate point in time using the Unix time t [IEEE1003**]** encoding of UTC, but with a precision of milliseconds.]
963 For example, 1311704463521 represents the moment 2011-07-26T18:21:03.521Z.
964
965 **SRS_AMQPVALUE_01_026: [**1.6.18 uuid A universally unique identifier as defined by RFC-4122 section 4.1.2 .**]**
966
967 \<type name="uuid" class="primitive">
968
969 **SRS_AMQPVALUE_01_296: [**\<encoding code="0x98" category="fixed" width="16" label="UUID as defined in section 4.1.2 of RFC-4122"/>**]**
970
971 </type>
972
973 **SRS_AMQPVALUE_01_100: [**UUID is defined in section 4.1.2 of RFC-4122 [RFC4122**]**.]
974
975 **SRS_AMQPVALUE_01_027: [**1.6.19 binary A sequence of octets.**]**
976
977 \<type name="binary" class="primitive">
978
979 **SRS_AMQPVALUE_01_297: [**\<encoding name="vbin8" code="0xa0" category="variable" width="1" label="up to 2^8 - 1 octets of binary data"/>**]**
980
981 **SRS_AMQPVALUE_01_298: [**\<encoding name="vbin32" code="0xb0" category="variable" width="4" label="up to 2^32 - 1 octets of binary data"/>**]**
982
983 </type>
984
985 **SRS_AMQPVALUE_01_028: [**1.6.20 string A sequence of Unicode characters.**]**
986
987 \<type name="string" class="primitive">
988
989 **SRS_AMQPVALUE_01_299: [**\<encoding name="str8-utf8" code="0xa1" category="variable" width="1" label="up to 2^8 - 1 octets worth of UTF-8 Unicode (with no byte order mark)"/>**]**
990
991 **SRS_AMQPVALUE_01_300: [**\<encoding name="str32-utf8" code="0xb1" category="variable" width="4" label="up to 2^32 - 1 octets worth of UTF-8 Unicode (with no byte order mark)"/>**]**
992
993 </type>
994
995 **SRS_AMQPVALUE_01_119: [**A string represents a sequence of Unicode characters as defined by the Unicode V6.0.0 standard [UNICODE6**]**.]
996
997 **SRS_AMQPVALUE_01_029: [**1.6.21 symbol Symbolic values from a constrained domain.**]**
998
999 \<type name="symbol" class="primitive">
1000
1001 **SRS_AMQPVALUE_01_301: [**\<encoding name="sym8" code="0xa3" category="variable" width="1" label="up to 2^8 - 1 seven bit ASCII characters representing a symbolic value"/>**]**
1002
1003 **SRS_AMQPVALUE_01_302: [**\<encoding name="sym32" code="0xb3" category="variable" width="4" label="up to 2^32 - 1 seven bit ASCII characters representing a symbolic value"/>**]**
1004
1005 </type>
1006
1007 Symbols are values from a constrained domain. Although the set of possible domains is open-ended, typically the both number and size of symbols in use for any given application will be small, e.g. small enough that it is reasonable to cache all the distinct values. **SRS_AMQPVALUE_01_122: [**Symbols are encoded as ASCII characters [ASCII**]**.]
1008
1009 **SRS_AMQPVALUE_01_030: [**1.6.22 list A sequence of polymorphic values.**]**
1010
1011 \<type name="list" class="primitive">
1012
1013 **SRS_AMQPVALUE_01_303: [**\<encoding name="list0" code="0x45" category="fixed" width="0" label="the empty list (i.e. the list with no elements)"/>**]**
1014
1015 **SRS_AMQPVALUE_01_304: [**\<encoding name="list8" code="0xc0" category="compound" width="1" label="up to 2^8 - 1 list elements with total size less than 2^8 octets"/>**]**
1016
1017 **SRS_AMQPVALUE_01_305: [**\<encoding name="list32" code="0xd0" category="compound" width="4" label="up to 2^32 - 1 list elements with total size less than 2^32 octets"/>**]**
1018
1019 </type>
1020
1021 **SRS_AMQPVALUE_01_031: [**1.6.23 map A polymorphic mapping from distinct keys to values.**]**
1022
1023 \<type name="map" class="primitive">
1024
1025 **SRS_AMQPVALUE_01_306: [**\<encoding name="map8" code="0xc1" category="compound" width="1" label="up to 2^8 - 1 octets of encoded map data"/>**]**
1026
1027 **SRS_AMQPVALUE_01_307: [**\<encoding name="map32" code="0xd1" category="compound" width="4" label="up to 2^32 - 1 octets of encoded map data"/>**]**
1028
1029 </type>
1030
1031 **SRS_AMQPVALUE_01_123: [**A map is encoded as a compound value where the constituent elements form alternating key value pairs.**]**
1032
1033 ...
1034
1035 Figure 1.20: Layout of Map Encoding
1036 **SRS_AMQPVALUE_01_124: [**Map encodings MUST contain an even number of items (i.e. an equal number of keys and values).**]**
1037 **SRS_AMQPVALUE_01_125: [**A map in which there exist two identical key values is invalid.**]** **SRS_AMQPVALUE_01_126: [**Unless known to be otherwise, maps MUST be considered to be ordered, that is, the order of the key-value pairs is semantically important and two maps which are different only in the order in which their key-value pairs are encoded are not equal.**]**
1038
1039 **SRS_AMQPVALUE_01_397: [**1.6.24 array A sequence of values of a single type.**]**
1040
1041 \<type name="array" class="primitive">
1042
1043 **SRS_AMQPVALUE_01_398: [**\<encoding name="array8" code="0xe0" category="array" width="1" label="up to 2^8 - 1 array elements with total size less than 2^8 octets"/>**]**
1044
1045 **SRS_AMQPVALUE_01_399: [**\<encoding name="array32" code="0xf0" category="array" width="4" label="up to 2^32 - 1 array elements with total size less than 2^32 octets"/>**]**
1046
1047 </type>
1048
1049 ### Decoding ISO Section
1050
1051 Primitive Type Definitions
1052
1053 **SRS_AMQPVALUE_01_328: [**1.6.1 null Indicates an empty value.**]**
1054
1055 \<type name="null" class="primitive">
1056
1057 **SRS_AMQPVALUE_01_329: [**\<encoding code="0x40" category="fixed" width="0" label="the null value"/>**]**
1058
1059 </type>
1060
1061 **SRS_AMQPVALUE_01_330: [**1.6.2 boolean Represents a true or false value.**]**
1062
1063 \<type name="boolean" class="primitive">
1064
1065 **SRS_AMQPVALUE_01_331: [**\<encoding code="0x56" category="fixed" width="1" label="boolean with the octet 0x00 being false and octet 0x01 being true"/>**]**
1066
1067 **SRS_AMQPVALUE_01_332: [**\<encoding name="true" code="0x41" category="fixed" width="0" label="the boolean value true"/>**]**
1068
1069 **SRS_AMQPVALUE_01_333: [**\<encoding name="false" code="0x42" category="fixed" width="0" label="the boolean value false"/>**]**
1070
1071 </type>
1072
1073 **SRS_AMQPVALUE_01_334: [**1.6.3 ubyte Integer in the range 0 to 28 - 1 inclusive.**]**
1074
1075 \<type name="ubyte" class="primitive">
1076
1077 **SRS_AMQPVALUE_01_335: [**\<encoding code="0x50" category="fixed" width="1" label="8-bit unsigned integer"/>**]**
1078
1079 </type>
1080
1081 **SRS_AMQPVALUE_01_336: [**1.6.4 ushort Integer in the range 0 to 216 - 1 inclusive.**]**
1082
1083 \<type name="ushort" class="primitive">
1084
1085 **SRS_AMQPVALUE_01_337: [**\<encoding code="0x60" category="fixed" width="2" label="16-bit unsigned integer in network byte order"/>**]**
1086
1087 </type>
1088
1089 **SRS_AMQPVALUE_01_338: [**1.6.5 uint Integer in the range 0 to 232 - 1 inclusive.**]**
1090
1091 \<type name="uint" class="primitive">
1092
1093 **SRS_AMQPVALUE_01_339: [**\<encoding code="0x70" category="fixed" width="4" label="32-bit unsigned integer in network byte order"/>**]**
1094
1095 **SRS_AMQPVALUE_01_340: [**\<encoding name="smalluint" code="0x52" category="fixed" width="1" label="unsigned integer value in the range 0 to 255 inclusive"/>**]**
1096
1097 **SRS_AMQPVALUE_01_341: [**\<encoding name="uint0" code="0x43" category="fixed" width="0" label="the uint value 0"/>**]**
1098
1099 </type>
1100
1101 **SRS_AMQPVALUE_01_342: [**1.6.6 ulong Integer in the range 0 to 264 - 1 inclusive.**]**
1102
1103 \<type name="ulong" class="primitive">
1104
1105 **SRS_AMQPVALUE_01_343: [**\<encoding code="0x80" category="fixed" width="8" label="64-bit unsigned integer in network byte order"/>**]**
1106
1107 **SRS_AMQPVALUE_01_344: [**\<encoding name="smallulong" code="0x53" category="fixed" width="1" label="unsigned long value in the range 0 to 255 inclusive"/>**]**
1108
1109 **SRS_AMQPVALUE_01_345: [**\<encoding name="ulong0" code="0x44" category="fixed" width="0" label="the ulong value 0"/>**]**
1110
1111 </type>
1112
1113 **SRS_AMQPVALUE_01_346: [**1.6.7 byte Integer in the range -(27) to 27 - 1 inclusive.**]**
1114
1115 \<type name="byte" class="primitive">
1116
1117 **SRS_AMQPVALUE_01_347: [**\<encoding code="0x51" category="fixed" width="1" label="8-bit two's-complement integer"/>**]**
1118
1119 </type>
1120
1121 **SRS_AMQPVALUE_01_348: [**1.6.8 short Integer in the range -(215) to 215 - 1 inclusive.**]**
1122
1123 \<type name="short" class="primitive">
1124
1125 **SRS_AMQPVALUE_01_349: [**\<encoding code="0x61" category="fixed" width="2" label="16-bit two's-complement integer in network byte order"/>**]**
1126
1127 </type>
1128
1129 **SRS_AMQPVALUE_01_350: [**1.6.9 int Integer in the range -(231) to 231 - 1 inclusive.**]**
1130
1131 \<type name="int" class="primitive">
1132
1133 **SRS_AMQPVALUE_01_351: [**\<encoding code="0x71" category="fixed" width="4" label="32-bit two's-complement integer in network byte order"/>**]**
1134
1135 **SRS_AMQPVALUE_01_352: [**\<encoding name="smallint" code="0x54" category="fixed" width="1" label="8-bit two's-complement integer"/>**]**
1136
1137 </type>
1138
1139 **SRS_AMQPVALUE_01_353: [**1.6.10 long Integer in the range -(263) to 263 - 1 inclusive.**]**
1140
1141 \<type name="long" class="primitive">
1142
1143 **SRS_AMQPVALUE_01_354: [**\<encoding code="0x81" category="fixed" width="8" label="64-bit two's-complement integer in network byte order"/>**]**
1144
1145 **SRS_AMQPVALUE_01_355: [**\<encoding name="smalllong" code="0x55" category="fixed" width="1" label="8-bit two's-complement integer"/>**]**
1146
1147 </type>
1148
1149 **SRS_AMQPVALUE_01_356: [**1.6.11 float 32-bit floating point number (IEEE 754-2008 binary32).**]**
1150
1151 \<type name="float" class="primitive">
1152
1153 **SRS_AMQPVALUE_01_357: [**\<encoding name="ieee-754" code="0x72" category="fixed" width="4" label="IEEE 754-2008 binary32"/>**]**
1154
1155 </type>
1156
1157 A 32-bit floating point number (IEEE 754-2008 binary32 [IEEE754]).
1158
1159 **SRS_AMQPVALUE_01_358: [**1.6.12 double 64-bit floating point number (IEEE 754-2008 binary64).**]**
1160
1161 \<type name="double" class="primitive">
1162
1163 **SRS_AMQPVALUE_01_359: [**\<encoding name="ieee-754" code="0x82" category="fixed" width="8" label="IEEE 754-2008 binary64"/>**]**
1164
1165 </type>
1166
1167 A 64-bit floating point number (IEEE 754-2008 binary64 [IEEE754]).
1168
1169 **SRS_AMQPVALUE_01_360: [**1.6.13 decimal32 32-bit decimal number (IEEE 754-2008 decimal32).**]**
1170
1171 \<type name="decimal32" class="primitive">
1172
1173 **SRS_AMQPVALUE_01_361: [**\<encoding name="ieee-754" code="0x74" category="fixed" width="4" label="IEEE 754-2008 decimal32 using the Binary Integer Decimal encoding"/>**]**
1174
1175 </type>
1176
1177 A 32-bit decimal number (IEEE 754-2008 decimal32 [IEEE754]).
1178
1179 **SRS_AMQPVALUE_01_362: [**1.6.14 decimal64 64-bit decimal number (IEEE 754-2008 decimal64).**]**
1180
1181 \<type name="decimal64" class="primitive">
1182
1183 **SRS_AMQPVALUE_01_363: [**\<encoding name="ieee-754" code="0x84" category="fixed" width="8" label="IEEE 754-2008 decimal64 using the Binary Integer Decimal encoding"/>**]**
1184
1185 </type>
1186
1187 A 64-bit decimal number (IEEE 754-2008 decimal64 [IEEE754]).
1188
1189 **SRS_AMQPVALUE_01_364: [**1.6.15 decimal128 128-bit decimal number (IEEE 754-2008 decimal128).**]**
1190
1191 \<type name="decimal128" class="primitive">
1192
1193 **SRS_AMQPVALUE_01_365: [**\<encoding name="ieee-754" code="0x94" category="fixed" width="16" label="IEEE 754-2008 decimal128 using the Binary Integer Decimal encoding"/>**]**
1194
1195 </type>
1196
1197 A 128-bit decimal number (IEEE 754-2008 decimal128 [IEEE754]).
1198
1199 **SRS_AMQPVALUE_01_366: [**1.6.16 char A single Unicode character.**]**
1200
1201 \<type name="char" class="primitive">
1202
1203 **SRS_AMQPVALUE_01_367: [**\<encoding name="utf32" code="0x73" category="fixed" width="4" label="a UTF-32BE encoded Unicode character"/>**]**
1204
1205 </type>
1206
1207 A UTF-32BE encoded Unicode character [UNICODE6].
1208
1209 **SRS_AMQPVALUE_01_368: [**1.6.17 timestamp An absolute point in time.**]**
1210
1211 \<type name="timestamp" class="primitive">
1212
1213 **SRS_AMQPVALUE_01_369: [**\<encoding name="ms64" code="0x83" category="fixed" width="8" label="64-bit two's-complement integer representing milliseconds since the unix epoch"/>**]**
1214
1215 </type>
1216
1217 Represents an approximate point in time using the Unix time t [IEEE1003] encoding of UTC, but with a precision
1218 of milliseconds. For example, 1311704463521 represents the moment 2011-07-26T18:21:03.521Z.
1219
1220 **SRS_AMQPVALUE_01_370: [**1.6.18 uuid A universally unique identifier as defined by RFC-4122 section 4.1.2 .**]**
1221
1222 \<type name="uuid" class="primitive">
1223
1224 **SRS_AMQPVALUE_01_371: [**\<encoding code="0x98" category="fixed" width="16" label="UUID as defined in section 4.1.2 of RFC-4122"/>**]**
1225
1226 </type>
1227
1228 UUID is defined in section 4.1.2 of RFC-4122 [RFC4122].
1229
1230 **SRS_AMQPVALUE_01_372: [**1.6.19 binary A sequence of octets.**]**
1231
1232 \<type name="binary" class="primitive">
1233
1234 **SRS_AMQPVALUE_01_373: [**\<encoding name="vbin8" code="0xa0" category="variable" width="1" label="up to 2^8 - 1 octets of binary data"/>**]**
1235
1236 **SRS_AMQPVALUE_01_374: [**\<encoding name="vbin32" code="0xb0" category="variable" width="4" label="up to 2^32 - 1 octets of binary data"/>**]**
1237
1238 </type>
1239
1240 **SRS_AMQPVALUE_01_375: [**1.6.20 string A sequence of Unicode characters.**]**
1241
1242 \<type name="string" class="primitive">
1243
1244 **SRS_AMQPVALUE_01_376: [**\<encoding name="str8-utf8" code="0xa1" category="variable" width="1" label="up to 2^8 - 1 octets worth of UTF-8 Unicode (with no byte order mark)"/>**]**
1245
1246 **SRS_AMQPVALUE_01_377: [**\<encoding name="str32-utf8" code="0xb1" category="variable" width="4" label="up to 2^32 - 1 octets worth of UTF-8 Unicode (with no byte order mark)"/>**]**
1247
1248 </type>
1249
1250 A string represents a sequence of Unicode characters as defined by the Unicode V6.0.0 standard [UNICODE6].
1251
1252 **SRS_AMQPVALUE_01_378: [**1.6.21 symbol Symbolic values from a constrained domain.**]**
1253
1254 \<type name="symbol" class="primitive">
1255
1256 **SRS_AMQPVALUE_01_379: [**\<encoding name="sym8" code="0xa3" category="variable" width="1" label="up to 2^8 - 1 seven bit ASCII characters representing a symbolic value"/>**]**
1257
1258 **SRS_AMQPVALUE_01_380: [**\<encoding name="sym32" code="0xb3" category="variable" width="4" label="up to 2^32 - 1 seven bit ASCII characters representing a symbolic value"/>**]**
1259
1260 </type>
1261
1262 Symbols are values from a constrained domain. Although the set of possible domains is open-ended, typically the both number and size of symbols in use for any given application will be small, e.g. small enough that it is reasonable to cache all the distinct values. **SRS_AMQPVALUE_01_382: [**Symbols are encoded as ASCII characters [ASCII**]**.]
1263
1264 **SRS_AMQPVALUE_01_383: [**1.6.22 list A sequence of polymorphic values.**]**
1265
1266 \<type name="list" class="primitive">
1267
1268 **SRS_AMQPVALUE_01_384: [**\<encoding name="list0" code="0x45" category="fixed" width="0" label="the empty list (i.e. the list with no elements)"/>**]**
1269
1270 **SRS_AMQPVALUE_01_385: [**\<encoding name="list8" code="0xc0" category="compound" width="1" label="up to 2^8 - 1 list elements with total size less than 2^8 octets"/>**]**
1271
1272 **SRS_AMQPVALUE_01_386: [**\<encoding name="list32" code="0xd0" category="compound" width="4" label="up to 2^32 - 1 list elements with total size less than 2^32 octets"/>**]**
1273
1274 </type>
1275
1276 **SRS_AMQPVALUE_01_387: [**1.6.23 map A polymorphic mapping from distinct keys to values.**]**
1277
1278 \<type name="map" class="primitive">
1279
1280 **SRS_AMQPVALUE_01_388: [**\<encoding name="map8" code="0xc1" category="compound" width="1" label="up to 2^8 - 1 octets of encoded map data"/>**]**
1281
1282 **SRS_AMQPVALUE_01_389: [**\<encoding name="map32" code="0xd1" category="compound" width="4" label="up to 2^32 - 1 octets of encoded map data"/>**]**
1283
1284 </type>
1285
1286 **SRS_AMQPVALUE_01_390: [**A map is encoded as a compound value where the constituent elements form alternating key value pairs.**]**
1287
1288 ...
1289
1290 Figure 1.20: Layout of Map Encoding
1291
1292 **SRS_AMQPVALUE_01_391: [**Map encodings MUST contain an even number of items (i.e. an equal number of keys and values).**]** **SRS_AMQPVALUE_01_392: [**A map in which there exist two identical key values is invalid.**]** **SRS_AMQPVALUE_01_393: [**Unless known to be otherwise, maps MUST be considered to be ordered, that is, the order of the key-value pairs is semantically important and two maps which are different only in the order in which their key-value pairs are encoded are not equal.**]**
1293
1294 **SRS_AMQPVALUE_01_394: [**1.6.24 array A sequence of values of a single type.**]**
1295
1296 \<type name="array" class="primitive">
1297
1298 **SRS_AMQPVALUE_01_395: [**\<encoding name="array8" code="0xe0" category="array" width="1" label="up to 2^8 - 1 array elements with total size less than 2^8 octets"/>**]**
1299
1300 **SRS_AMQPVALUE_01_396: [**\<encoding name="array32" code="0xf0" category="array" width="4" label="up to 2^32 - 1 array elements with total size less than 2^32 octets"/>**]**
1301
1302 </type>