Lines Matching full:if
86 * if (cbor_parser_init(buffer, len, 0, &buffer, &value) != CborNoError)
88 * if (!cbor_value_is_integer(&value) ||
101 * be represented in a variable of type \c{int}. If detecting that case is
120 * behavior if called after an error has been reported, and may crash.
139 * \if privatedocs
145 …* \li remaining: remaining items in this collection after this item or UINT32_MAX if length is u…
155 if (err) { in extract_length()
161 if (v != *len) in extract_length()
178 if (it->offset == parser->end) in preparse_value()
187 if (descriptor > Value64Bit) { in preparse_value()
188 if (unlikely(descriptor != IndefiniteLength)) in preparse_value()
190 if (likely(!is_fixed_type(type))) { in preparse_value()
200 if (bytesNeeded + 1 > (size_t)(parser->end - it->offset)) in preparse_value()
204 if (majortype == NegativeIntegerType) { in preparse_value()
207 } else if (majortype == SimpleTypesType) { in preparse_value()
228 if (unlikely(it->extra < 32)) { in preparse_value()
246 if (descriptor < Value8Bit) in preparse_value()
249 if (descriptor == Value8Bit) in preparse_value()
251 else if (descriptor == Value16Bit) in preparse_value()
260 if (it->remaining != UINT32_MAX) { in preparse_next_value()
261 /* don't decrement the item count if the current item is tag: they don't count */ in preparse_next_value()
262 if (it->type != CborTagType && !--it->remaining) { in preparse_next_value()
266 } else if (it->remaining == UINT32_MAX && it->offset != it->parser->end && in preparse_next_value()
282 if (err != CborNoError) { in advance_internal()
286 if (it->type == CborByteStringType || it->type == CborTextStringType) { in advance_internal()
315 if ((val & 1) == (Value32Bit & 1)) in _cbor_value_decode_int64_internal()
348 * Returns true if \a it has reached the end of the iteration, usually when
353 * remaining data (if any) can be obtained with cbor_value_get_next_byte().
361 * Returns a pointer to the next byte that would be decoded if this CborValue
364 * This function is useful if cbor_value_at_end() returns true for the
366 * remaining in the buffer, if any. Code can decide whether to begin decoding a
370 * This function may be used even after a parsing error. If that occurred,
381 * Returns true if the iterator \a it contains a valid value. Invalid iterators
393 * If the type is not of fixed size, this function has undefined behavior. Code
398 * If the caller is not able to determine whether the type is fixed or not, code
407 if (!it->remaining) in cbor_value_advance_fixed()
414 if (is_fixed_type(it->type)) in advance_recursive()
417 if (!cbor_value_is_container(it)) { in advance_recursive()
423 if (nestingLevel == CBOR_PARSER_MAX_RECURSIONS) in advance_recursive()
429 if (err) in advance_recursive()
433 if (err) in advance_recursive()
443 * value of any type. However, if the type is a container (map or array) or a
454 if (!it->remaining) in cbor_value_advance()
462 * Returns true if the iterator \a value is valid and points to a CBOR tag.
471 * result. If the iterator \a value does not point to a CBOR tag value, the
479 * Advances the CBOR value \a it until it no longer points to a tag. If \a it is
491 if (err) in cbor_value_skip_tag()
500 * Returns true if the \a it value is a container and requires recursion in
520 if (it->flags & CborIteratorFlag_UnknownLength) { in cbor_value_enter_container()
524 if (err != CborErrorUnexpectedBreak) in cbor_value_enter_container()
535 if (recursed->remaining != len || len == UINT32_MAX) { in cbor_value_enter_container()
540 if (recursed->type == CborMapType) { in cbor_value_enter_container()
542 if (recursed->remaining > UINT32_MAX / 2) { in cbor_value_enter_container()
549 if (len != 0) in cbor_value_enter_container()
583 * Returns the type of the CBOR value that the iterator \a value points to. If
587 * TinyCBOR also provides functions to test directly if a given CborValue object
596 * Returns true if the iterator \a value is valid and points to a CBOR null type.
604 * Returns true if the iterator \a value is valid and points to a CBOR undefined type.
612 * Returns true if the iterator \a value is valid and points to a CBOR boolean
622 * result. If the iterator \a value does not point to a boolean value, the
632 * Returns true if the iterator \a value is valid and points to a CBOR Simple Type
642 * in \a result. If the iterator \a value does not point to a simple_type
652 * Returns true if the iterator \a value is valid and points to a CBOR integer
661 * Returns true if the iterator \a value is valid and points to a CBOR unsigned
670 * Returns true if the iterator \a value is valid and points to a CBOR negative
680 * result. If the iterator \a value does not point to an integer value, the
695 * result. If the iterator \a value does not point to an integer value, the
710 * result. If the iterator \a value does not point to an unsigned integer
721 * result. If the iterator \a value does not point to an integer value, the
728 * If the integer is unsigned (that is, if cbor_value_is_unsigned_integer()
729 * returns true), then \a result will contain the actual value. If the integer
740 * result. If the iterator \a value does not point to an integer value, the
744 * Unlike cbor_value_get_int64(), this function performs a check to see if the
745 * stored integer fits in \a result without data loss. If the number is outside
748 * cbor_value_get_uint64() (if the number is positive) or
759 * "[if] the new type is signed and the value cannot be represented in it; either the in cbor_value_get_int64_checked()
768 if (unlikely(v > (uint64_t)INT64_MAX)) in cbor_value_get_int64_checked()
772 if (value->flags & CborIteratorFlag_NegativeInteger) in cbor_value_get_int64_checked()
779 * result. If the iterator \a value does not point to an integer value, the
783 * Unlike cbor_value_get_int(), this function performs a check to see if the
784 * stored integer fits in \a result without data loss. If the number is outside
798 * "[if] the new type is signed and the value cannot be represented in it; either the in cbor_value_get_int_checked()
807 if (value->flags & CborIteratorFlag_NegativeInteger) { in cbor_value_get_int_checked()
808 if (unlikely(v > (unsigned) -(INT_MIN + 1))) in cbor_value_get_int_checked()
814 if (unlikely(v > (uint64_t)INT_MAX)) in cbor_value_get_int_checked()
826 * Returns true if the length of this type is known without calculation. That
827 * is, if the length of this CBOR string, map or array is encoded in the data
828 * stream, this function returns true. If the length is not encoded, it returns
831 * If the length is known, code can call cbor_value_get_string_length(),
833 * length. If the length is not known but is necessary, code can use the
841 * Returns true if the iterator \a value is valid and points to a CBOR text
852 * Returns true if the iterator \a value is valid and points to a CBOR text
864 * stores it in \a result. If the iterator \a value does not point to a text
869 * If the length of this string is not encoded in the CBOR data stream, this
873 * If the length of the string is required but the length was not encoded, use
878 * CborErrorDataTooLarge if the stream indicates a length that is too big to
886 * stores it in \a len. If the iterator \a value does not point to a text
897 * CborErrorDataTooLarge if the stream indicates a length that is too big to
931 if (cbor_value_is_length_known(value)) { in iterate_string_chunks()
934 if (err) in iterate_string_chunks()
936 if (total > (size_t)(value->parser->end - offset)) in iterate_string_chunks()
938 if (total <= *buflen) in iterate_string_chunks()
953 if (offset == value->parser->end) in iterate_string_chunks()
958 if (val == (uint8_t)BreakByte) { in iterate_string_chunks()
964 if ((val & MajorTypeMask) != value->type) in iterate_string_chunks()
968 if (err) in iterate_string_chunks()
971 if (unlikely(add_check_overflow(total, chunkLen, &newTotal))) in iterate_string_chunks()
974 if (chunkLen > (size_t)(value->parser->end - offset)) in iterate_string_chunks()
977 if (*result && *buflen >= newTotal) in iterate_string_chunks()
988 if (*result && *buflen > total) { in iterate_string_chunks()
991 * reader. Since this is the output buffer, we can assume that if in iterate_string_chunks()
993 if(buffer) { in iterate_string_chunks()
999 if (next) { in iterate_string_chunks()
1011 * of \a buflen bytes. If \a buffer is a NULL pointer, this function will not
1014 * If the iterator \a value does not point to a text string, the behaviour is
1018 * If the provided buffer length was too small, this function returns an error
1019 * condition of \ref CborErrorOutOfMemory. If you need to calculate the length
1023 * On success, this function sets the number of bytes copied to \c{*buflen}. If
1028 * The \a next pointer, if not null, will be updated to point to the next item
1029 * after this string. If \a value points to the last item, then \a next will be
1045 * of \a buflen bytes. If \a buffer is a NULL pointer, this function will not
1048 * If the iterator \a value does not point to a byte string, the behaviour is
1052 * If the provided buffer length was too small, this function returns an error
1053 * condition of \ref CborErrorOutOfMemory. If you need to calculate the length
1057 * On success, this function sets the number of bytes copied to \c{*buflen}. If
1062 * The \a next pointer, if not null, will be updated to point to the next item
1063 * after this string. If \a value points to the last item, then \a next will be
1084 * in \a result. If the value is different from \a string \a result will
1087 * The entry at \a value may be a tagged string. If \a is not a string or a
1104 if (err) in cbor_value_text_string_equals()
1106 if (!cbor_value_is_text_string(©)) { in cbor_value_text_string_equals()
1119 * Returns true if the iterator \a value is valid and points to a CBOR array.
1128 * in \a result. If the iterator \a value does not point to a CBOR array, the
1132 * If the length of this array is not encoded in the CBOR data stream, this
1137 * CborErrorDataTooLarge if the stream indicates a length that is too big to
1146 * Returns true if the iterator \a value is valid and points to a CBOR map.
1155 * \a result. If the iterator \a value does not point to a CBOR map, the
1159 * If the length of this map is not encoded in the CBOR data stream, this
1164 * CborErrorDataTooLarge if the stream indicates a length that is too big to
1172 * entry \a string. If the iterator \a value does not point to a CBOR map, the
1176 * If the item is found, it is stored in \a result. If no item is found
1193 if (err) in cbor_value_map_find_value()
1199 if (err) in cbor_value_map_find_value()
1201 if (cbor_value_is_text_string(element)) { in cbor_value_map_find_value()
1206 if (err) in cbor_value_map_find_value()
1208 if (equals && string[dummyLen] == '\0') in cbor_value_map_find_value()
1213 if (err) in cbor_value_map_find_value()
1219 if (err) in cbor_value_map_find_value()
1222 if (err) in cbor_value_map_find_value()
1238 * Returns true if the iterator \a value is valid and points to a CBOR
1248 * value points to and stores it in \a result. If the iterator \a value does
1259 * Returns true if the iterator \a value is valid and points to a CBOR
1269 * value points to and stores it in \a result. If the iterator \a value does
1280 * Returns true if the iterator \a value is valid and points to a CBOR
1288 * value points to and stores it in \a result. If the iterator \a value does