lib: os: cbprintf: Add support for conversion to fsc package
Added support for conversion from a standard package which contains pointers to read only strings to fully self-contained (fsc) package. Fsc package contains all strings associated with the package thus access to read only strings is not needed to format a string. In order to allow conversion to fsc package, standard package must contain locations of all string pointers within the package. Appending that information is optional and is controlled by flags parameter which was added to packaging API. If option flag is set then package contains header, arguments, locations of read only strings and transient strings (each prefixed with string argument location). Package header has been extended with field which contains number of read only string locations. A function for conversion to fsc package has been added (cbprintf_fsc_package()). Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
parent
fbe13b7bc2
commit
5d80cbae59
8 changed files with 282 additions and 49 deletions
|
@ -63,7 +63,7 @@ void z_impl_z_log_msg2_runtime_vcreate(uint8_t domain_id, const void *source,
|
|||
va_list ap2;
|
||||
|
||||
va_copy(ap2, ap);
|
||||
plen = cbvprintf_package(NULL, Z_LOG_MSG2_ALIGN_OFFSET,
|
||||
plen = cbvprintf_package(NULL, Z_LOG_MSG2_ALIGN_OFFSET, 0,
|
||||
fmt, ap2);
|
||||
__ASSERT_NO_MSG(plen >= 0);
|
||||
va_end(ap2);
|
||||
|
@ -83,7 +83,7 @@ void z_impl_z_log_msg2_runtime_vcreate(uint8_t domain_id, const void *source,
|
|||
}
|
||||
|
||||
if (msg && fmt) {
|
||||
plen = cbvprintf_package(msg->data, plen, fmt, ap);
|
||||
plen = cbvprintf_package(msg->data, plen, 0, fmt, ap);
|
||||
__ASSERT_NO_MSG(plen >= 0);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue