1.2.1
Macros
Array Generator

Macros

#define NAUGHTY_BUFFERS_ARRAY_DECLARATION(__NB_ARRAY_TYPE__, __NB_ARRAY_BLOCK_TYPE__)
 Declares a struct named using __NB_ARRAY_TYPE__ to handle blocks of type __NB_ARRAY_BLOCK_TYPE__.
 
#define NAUGHTY_BUFFERS_ARRAY_DEFINITION(__NB_ARRAY_TYPE__, __NB_ARRAY_BLOCK_TYPE__)
 Generates definitions for functions declared with NAUGHTY_BUFFERS_ARRAY_DECLARATION.
 

Detailed Description

The macros contained here can be used to generate a new struct and a group of functions that provide a type-safe API to handle all kind of types. The functions are equivalent to using the ones defined in buffer.h but they are declared to hold a single type of data. Everything declared and defined by these macros are backed by nb_buffer structs and functions.

Usage

The recommended way of using these macros are as follows:

Generated code:

For array type T_array and data type T, the following is generated: