Commit c8d213a9 authored by Øyvind Rønningstad's avatar Øyvind Rønningstad Committed by Jamie
Browse files

zcbor: Copy source and header files

from zcbor 0.8.1

Signed-off-by: default avatarØyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
parent f09e205b
Loading
Loading
Loading
Loading
+20 −1
Changes for boot/zcbor/include/zcbor_common.h: 20 added lines, 1 removed line.
Original line number Diff line number Diff line
/*
 * This file has been copied from the zcbor library.
 * Commit zcbor 0.8.0
 * Commit zcbor 0.8.1
 */

/*
@@ -22,6 +22,23 @@
extern "C" {
#endif

#define ZCBOR_STRINGIFY_PRE(x) #x
#define ZCBOR_STRINGIFY(s) ZCBOR_STRINGIFY_PRE(s)

#define ZCBOR_VERSION_MAJOR 0
#define ZCBOR_VERSION_MINOR 8
#define ZCBOR_VERSION_BUGFIX 1

/** The version string with dots and not prefix. */
#define ZCBOR_VERSION_STR   ZCBOR_STRINGIFY(ZCBOR_VERSION_MAJOR) \
			"." ZCBOR_STRINGIFY(ZCBOR_VERSION_MINOR) \
			"." ZCBOR_STRINGIFY(ZCBOR_VERSION_BUGFIX)

/** Monotonically increasing integer representing the version. */
#define ZCBOR_VERSION    ((ZCBOR_VERSION_MAJOR << 24) \
			+ (ZCBOR_VERSION_MINOR << 16) \
			+ (ZCBOR_VERSION_BUGFIX << 8))

/** Convenience type that allows pointing to strings directly inside the payload
 *  without the need to copy out.
 */
@@ -488,6 +505,8 @@ static inline size_t zcbor_flags_to_states(size_t num_flags)
#define ZCBOR_FLAG_STATES(n_flags) 0
#endif

size_t strnlen(const char *, size_t);

#ifdef __cplusplus
}
#endif
+1 −1
Changes for boot/zcbor/include/zcbor_decode.h: 1 added line, 1 removed line.
Original line number Diff line number Diff line
/*
 * This file has been copied from the zcbor library.
 * Commit zcbor 0.8.0
 * Commit zcbor 0.8.1
 */

/*
+1 −1
Changes for boot/zcbor/include/zcbor_encode.h: 1 added line, 1 removed line.
Original line number Diff line number Diff line
/*
 * This file has been copied from the zcbor library.
 * Commit zcbor 0.8.0
 * Commit zcbor 0.8.1
 */

/*
+14 −10
Changes for boot/zcbor/include/zcbor_print.h: 14 added lines, 10 removed lines.
Original line number Diff line number Diff line
/*
 * This file has been copied from the zcbor library.
 * Commit zcbor 0.8.0
 * Commit zcbor 0.8.1
 */

/*
@@ -93,10 +93,12 @@ static void zcbor_print_compare_lines(const uint8_t *str1, const uint8_t *str2,
__attribute__((used))
static void zcbor_print_compare_strings(const uint8_t *str1, const uint8_t *str2, size_t size)
{
	for (size_t i = 0; i <= size / 16; i++) {
		zcbor_do_print("line %zu (char %zu)\r\n", i, i*16);
		zcbor_print_compare_lines(&str1[i*16], &str2[i*16],
			MIN(16, (size - i*16)));
	const size_t col_width = 16;

	for (size_t i = 0; i <= size / col_width; i++) {
		zcbor_do_print("line %zu (char %zu)\r\n", i, i*col_width);
		zcbor_print_compare_lines(&str1[i*col_width], &str2[i*col_width],
			MIN(col_width, (size - i*col_width)));
	}
	zcbor_do_print("\r\n");
}
@@ -104,12 +106,14 @@ static void zcbor_print_compare_strings(const uint8_t *str1, const uint8_t *str2
__attribute__((used))
static void zcbor_print_compare_strings_diff(const uint8_t *str1, const uint8_t *str2, size_t size)
{
	const size_t col_width = 16;
	bool printed = false;
	for (size_t i = 0; i <= size / 16; i++) {
		if (memcmp(&str1[i*16], &str2[i*16], MIN(16, (size - i*16))) != 0) {
			zcbor_do_print("line %zu (char %zu)\r\n", i, i*16);
			zcbor_print_compare_lines(&str1[i*16], &str2[i*16],
				MIN(16, (size - i*16)));

	for (size_t i = 0; i <= size / col_width; i++) {
		if (memcmp(&str1[i*col_width], &str2[i*col_width], MIN(col_width, (size - i*col_width))) != 0) {
			zcbor_do_print("line %zu (char %zu)\r\n", i, i*col_width);
			zcbor_print_compare_lines(&str1[i*col_width], &str2[i*col_width],
				MIN(col_width, (size - i*col_width)));
			printed = true;
		}
	}
+1 −1
Changes for boot/zcbor/include/zcbor_tags.h: 1 added line, 1 removed line.
Original line number Diff line number Diff line
/*
 * This file has been copied from the zcbor library.
 * Commit zcbor 0.8.0
 * Commit zcbor 0.8.1
 */

/*
Loading