Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
Settings name processing

API for const name processing. More...

Functions

int settings_name_steq (const char *name, const char *key, const char **next)
 
int settings_name_next (const char *name, const char **next)
 

Detailed Description

API for const name processing.

Function Documentation

◆ settings_name_next()

int settings_name_next ( const char *  name,
const char **  next 
)

#include <include/settings/settings.h>

determine the number of characters before the first separator

Parameters
[in]namein string format
[out]nextpointer to remaining of name (excluding separator)
Returns
index of the first separator, in case no separator was found this is the size of name

◆ settings_name_steq()

int settings_name_steq ( const char *  name,
const char *  key,
const char **  next 
)

#include <include/settings/settings.h>

Compares the start of name with a key

Parameters
[in]namein string format
[in]keycomparison string
[out]nextpointer to remaining of name, when the remaining part starts with a separator the separator is removed from next

Some examples: settings_name_steq("bt/btmesh/iv", "b", &next) returns 1, next="t/btmesh/iv" settings_name_steq("bt/btmesh/iv", "bt", &next) returns 1, next="btmesh/iv" settings_name_steq("bt/btmesh/iv", "bt/", &next) returns 0, next=NULL settings_name_steq("bt/btmesh/iv", "bta", &next) returns 0, next=NULL

REMARK: This routine could be simplified if the settings_handler names would include a separator at the end.

Returns
0: no match 1: match, next can be used to check if match is full