pw_tokenizer: Tokenization domains
- Add support for tokenization domains. Strings tokenized in each domain
are stored separately and can be processed differently. Using domains
is optional; strings are tokenized in the "default" domain by default.
- Provide *_DOMAIN versions of the tokenization macros to allow
specifying the domain.
- Update docs and add tests for tokenization domain macros.
- Clean up the tokenizer macros to reduce duplication.
- Use a leading underscore for the private tokenizer functions.
- Use the pw_ prefix for the ELF sections and the linker script example.
Change-Id: I14c6e84a7a954669c9ddf50a9b6d32b8e19d6f16
diff --git a/pw_tokenizer/tokenize.cc b/pw_tokenizer/tokenize.cc
index 9edbb12..4f29876 100644
--- a/pw_tokenizer/tokenize.cc
+++ b/pw_tokenizer/tokenize.cc
@@ -26,11 +26,11 @@
namespace pw {
namespace tokenizer {
-extern "C" void pw_TokenizeToBuffer(void* buffer,
- size_t* buffer_size_bytes,
- pw_TokenizerStringToken token,
- pw_TokenizerArgTypes types,
- ...) {
+extern "C" void _pw_TokenizeToBuffer(void* buffer,
+ size_t* buffer_size_bytes,
+ pw_TokenizerStringToken token,
+ pw_TokenizerArgTypes types,
+ ...) {
if (*buffer_size_bytes < sizeof(token)) {
*buffer_size_bytes = 0;
return;
@@ -50,7 +50,7 @@
*buffer_size_bytes = sizeof(token) + encoded_bytes;
}
-extern "C" void pw_TokenizeToCallback(
+extern "C" void _pw_TokenizeToCallback(
void (*callback)(const uint8_t* encoded_message, size_t size_bytes),
pw_TokenizerStringToken token,
pw_TokenizerArgTypes types,