CLibs
|
#include <stdio.h>
Go to the source code of this file.
Macros | |
#define | ARRAY_PRINT_DEFAULT_STARTSTR "[ " |
#define | ARRAY_PRINT_DEFAULT_ENDSTR " ]" |
#define | ARRAY_PRINT_DEFAULT_DELIM ", " |
#define | array_fprintf_sde(FILESTREAM, ARRAY, ARRLEN, TYPE, FORMAT_STR, START_STR, DELIM, END_STR) |
#define | array_fprintf_d(FILESTREAM, ARRAY, ARRLEN, TYPE, FORMAT_STR, DELIM) |
#define | array_fprintf(FILESTREAM, ARRAY, ARRLEN, TYPE, FORMAT_STR) |
#define | array_printf_sde(ARRAY, ARRLEN, TYPE, FORMAT_STR, START_STR, DELIM, END_STR) |
#define | array_printf_d(ARRAY, ARRLEN, TYPE, FORMAT_STR, DELIM) |
#define | array_printf(ARRAY, ARRLEN, TYPE, FORMAT_STR) |
#define | array_sprintf_sde(STRINGVAR, ARRAY, ARRLEN, TYPE, FMTSTR, STARTSTR, DELIM, ENDSTR) |
#define | array_sprintf_d(STRINGVAR, ARRAY, ARRLEN, TYPE, FMTSTR, DELIM) |
#define | array_sprintf(STRING, ARRAY, ARRLEN, TYPE, FMTSTR) |
#define array_fprintf | ( | FILESTREAM, | |
ARRAY, | |||
ARRLEN, | |||
TYPE, | |||
FORMAT_STR ) |
#define array_fprintf_d | ( | FILESTREAM, | |
ARRAY, | |||
ARRLEN, | |||
TYPE, | |||
FORMAT_STR, | |||
DELIM ) |
#define array_fprintf_sde | ( | FILESTREAM, | |
ARRAY, | |||
ARRLEN, | |||
TYPE, | |||
FORMAT_STR, | |||
START_STR, | |||
DELIM, | |||
END_STR ) |
Prints each element of an array according to a format string as if by printf.
Every other array_*printf* is a specialization of this one.
FILESTREAM | File to print to |
ARRAY | array of type TYPE and length ARRLEN |
ARRLEN | length of ARRAY |
TYPE | type of member of ARRAY |
FORMAT_STR | format string for printing elements |
START_STR | printed once at the start |
DELIM | printed between each element |
END_STR | printed once at the end |
#define ARRAY_PRINT_DEFAULT_DELIM ", " |
#define ARRAY_PRINT_DEFAULT_ENDSTR " ]" |
#define ARRAY_PRINT_DEFAULT_STARTSTR "[ " |
#define array_printf | ( | ARRAY, | |
ARRLEN, | |||
TYPE, | |||
FORMAT_STR ) |
#define array_printf_d | ( | ARRAY, | |
ARRLEN, | |||
TYPE, | |||
FORMAT_STR, | |||
DELIM ) |
#define array_printf_sde | ( | ARRAY, | |
ARRLEN, | |||
TYPE, | |||
FORMAT_STR, | |||
START_STR, | |||
DELIM, | |||
END_STR ) |
#define array_sprintf | ( | STRING, | |
ARRAY, | |||
ARRLEN, | |||
TYPE, | |||
FMTSTR ) |
#define array_sprintf_d | ( | STRINGVAR, | |
ARRAY, | |||
ARRLEN, | |||
TYPE, | |||
FMTSTR, | |||
DELIM ) |
#define array_sprintf_sde | ( | STRINGVAR, | |
ARRAY, | |||
ARRLEN, | |||
TYPE, | |||
FMTSTR, | |||
STARTSTR, | |||
DELIM, | |||
ENDSTR ) |
The contents of STRINGVAR are overwritten (the pointer itself is).
If allocation fails at any point during the main body of this macro, this results in STRINGVAR being NULL.
Requires previous definition of CLIBS_DYNSTRING_H, for example by #include "src/structs/dynstring.h"
STRINGVAR | a local variable into which a pointer to a string (a char *) gets saved |