#include "headers/attributes.h"
#include "headers/errors.h"
#include <stdbool.h>
Go to the source code of this file.
|
typedef void(* | PrintFunction) (const void *, size_t) |
| Interface for functions that print data.
|
◆ DECLARE_PRINT_FUNC
#define DECLARE_PRINT_FUNC |
( |
| name | ) |
|
Value:
#define ITEM_PRINT_FUNCTION_NAME(type)
Creates a function name token from the type (must be a single token)
Definition item_print_functions.h:29
Declares a PrintFunction
◆ DEFINE_PRINT_FUNC
#define DEFINE_PRINT_FUNC |
( |
| type, |
|
|
| format_str ) |
Value:
{ \
if ( nbytes != sizeof( type ) ) \
{ \
fwarnx( "invalid data" ); \
return; \
} \
\
{ \
printf( "‹" ); \
} \
printf( format_str, *( ( type * ) data ) ); \
printf( "›" ); \
}
#define TYPE_SEPARATOR
String which separates the type name (see PrintFunctions_DoPrintType) from the value.
Definition item_print_functions.h:24
LibraryDefined bool PrintFunctions_DoPrintType
If true, the functions defined by DEFINE_PRINT_FUNC also print the type name.
Definition item_print_functions.h:20
Defines a PrintFunction.
This function checks whether data size equals sizeof( type ) and prints the data as type, according to the format_string.
◆ ITEM_PRINT_FUNCTION_NAME
#define ITEM_PRINT_FUNCTION_NAME |
( |
| type | ) |
|
Value:
Creates a function name token from the type (must be a single token)
◆ TYPE_SEPARATOR
#define TYPE_SEPARATOR ": " |
String which separates the type name (see PrintFunctions_DoPrintType) from the value.
◆ PrintFunction
typedef void(* PrintFunction) (const void *, size_t) |
Interface for functions that print data.
◆ DECLARE_PRINT_FUNC() [1/11]
DECLARE_PRINT_FUNC |
( |
bool | | ) |
|
◆ DECLARE_PRINT_FUNC() [2/11]
DECLARE_PRINT_FUNC |
( |
byte | | ) |
|
◆ DECLARE_PRINT_FUNC() [3/11]
DECLARE_PRINT_FUNC |
( |
char | | ) |
|
◆ DECLARE_PRINT_FUNC() [4/11]
DECLARE_PRINT_FUNC |
( |
double | | ) |
|
◆ DECLARE_PRINT_FUNC() [5/11]
DECLARE_PRINT_FUNC |
( |
float | | ) |
|
◆ DECLARE_PRINT_FUNC() [6/11]
DECLARE_PRINT_FUNC |
( |
int | | ) |
|
◆ DECLARE_PRINT_FUNC() [7/11]
DECLARE_PRINT_FUNC |
( |
pointer | | ) |
|
◆ DECLARE_PRINT_FUNC() [8/11]
DECLARE_PRINT_FUNC |
( |
size_t | | ) |
|
◆ DECLARE_PRINT_FUNC() [9/11]
DECLARE_PRINT_FUNC |
( |
ssize_t | | ) |
|
◆ DECLARE_PRINT_FUNC() [10/11]
DECLARE_PRINT_FUNC |
( |
string | | ) |
|
◆ DECLARE_PRINT_FUNC() [11/11]
DECLARE_PRINT_FUNC |
( |
string_direct | | ) |
|
◆ PrintFunctions_DoPrintType
If true, the functions defined by DEFINE_PRINT_FUNC also print the type name.