思澈科技软件开发工具包  2.20
Section variables iterator

Data Structures

struct  section_t
 Single section description structure. More...
 
struct  section_set_t
 Set of the sections description structure. More...
 
struct  section_iter_t
 Section iterator structure. More...
 

Macros

#define SECTION_SET_DEF(_name, _type, _count)
 Create a set of sections. More...
 
#define SECTION_DEF_(_priority, _name, _type)   SECTION_DEF(CONCAT_2(_name, _priority), _type);
 
#define SECTION_SET_DEF_(_priority, _name)
 
#define SECTION_SET_ITEM_REGISTER(_name, _priority, _var)
 Macro to declare a variable and register it in the section set. More...
 

Functions

void section_iter_init (section_iter_t *p_iter, section_set_t const *p_set)
 Function for initializing the section set iterator. More...
 
void section_iter_next (section_iter_t *p_iter)
 Function for incrementing iterator. More...
 
static void * section_iter_get (section_iter_t const *p_iter)
 Function for getting the element pointed to by the iterator. More...
 

Detailed Description

Macro Definition Documentation

◆ SECTION_SET_DEF

#define SECTION_SET_DEF (   _name,
  _type,
  _count 
)

Create a set of sections.

Note
This macro reserves memory for the given set of sections.

A set of sections, is an ordered collections of sections.

Parameters
[in]_nameName of the set.
[in]_typeType of the elements stored in the sections.
[in]_countNumber of the sections in the set. This parameter is ignored in case of GCC.

◆ SECTION_SET_DEF_

#define SECTION_SET_DEF_ (   _priority,
  _name 
)
Value:
{ \
.p_start = SECTION_START_ADDR(CONCAT_2(_name, _priority)), \
.p_end = SECTION_END_ADDR(CONCAT_2(_name, _priority)), \
},

◆ SECTION_SET_ITEM_REGISTER

#define SECTION_SET_ITEM_REGISTER (   _name,
  _priority,
  _var 
)

Macro to declare a variable and register it in the section set.

Note
The order of the section in the set is based on the priority. The order with which variables are placed in a section is dependant on the order with which the linker encouters the variables during linking.
Parameters
[in]_nameName of the section set.
[in]_priorityPriority of the desired section.
[in]_varThe variable to register in the given section.

Function Documentation

◆ section_iter_get()

static void* section_iter_get ( section_iter_t const *  p_iter)
inlinestatic

Function for getting the element pointed to by the iterator.

Parameters
[in]p_iterPointer to the iterator.
Return values
Pointerto the element or NULL if iterator points end of the set.

◆ section_iter_init()

void section_iter_init ( section_iter_t p_iter,
section_set_t const *  p_set 
)

Function for initializing the section set iterator.

Parameters
[in]p_iterPointer to the iterator.
[in]p_setPointer to the sections set.

◆ section_iter_next()

void section_iter_next ( section_iter_t p_iter)

Function for incrementing iterator.

Parameters
[in]p_iterPointer to the iterator.
CONCAT_2
#define CONCAT_2(p1, p2)
Concatenates two parameters.
Definition: sf_type.h:102