safec 3.9
Safe C Library - ISO TR24731 Bounds Checking Interface
|
#include "safe_str_lib.h"
#include <stdbool.h>
#include <stdint.h>
#include <float.h>
#include <math.h>
Macros | |
#define | PRINTF_NTOA_BUFFER_SIZE 32U |
#define | PRINTF_FTOA_BUFFER_SIZE 32U |
#define | PRINTF_SUPPORT_FLOAT |
#define | PRINTF_SUPPORT_EXPONENTIAL |
#define | PRINTF_DEFAULT_FLOAT_PRECISION 6U |
#define | PRINTF_MAX_FLOAT 1e9 |
#define | PRINTF_SUPPORT_PTRDIFF_T |
#define | FLAGS_ZEROPAD (1U << 0U) |
#define | FLAGS_LEFT (1U << 1U) |
#define | FLAGS_PLUS (1U << 2U) |
#define | FLAGS_SPACE (1U << 3U) |
#define | FLAGS_HASH (1U << 4U) |
#define | FLAGS_UPPERCASE (1U << 5U) |
#define | FLAGS_CHAR (1U << 6U) |
#define | FLAGS_SHORT (1U << 7U) |
#define | FLAGS_LONG (1U << 8U) |
#define | FLAGS_LONG_LONG (1U << 9U) |
#define | FLAGS_PRECISION (1U << 10U) |
#define | FLAGS_ADAPT_EXP (1U << 11U) |
#define | FLAGS_LONG_DOUBLE (1U << 12U) |
Functions | |
static unsigned int | safec_strnlen_s (const char *str, size_t maxsize) |
static bool | safec_is_digit (char ch) |
static unsigned int | safec_atoi (const char **str) |
static size_t | safec_out_rev (out_fct_type out, char *buffer, size_t idx, size_t maxlen, const char *buf, size_t len, unsigned int width, unsigned int flags) |
static size_t | safec_ntoa_format (out_fct_type out, const char *funcname, char *buffer, size_t idx, size_t maxlen, char *buf, size_t len, bool negative, unsigned int base, unsigned int prec, unsigned int width, unsigned int flags) |
static size_t | safec_ntoa_long (out_fct_type out, const char *funcname, char *buffer, size_t idx, size_t maxlen, unsigned long value, bool negative, unsigned long base, unsigned int prec, unsigned int width, unsigned int flags) |
static size_t | safec_etoa (out_fct_type out, const char *funcname, char *buffer, size_t idx, size_t maxlen, double value, unsigned int prec, unsigned int width, unsigned int flags) |
static size_t | safec_ftoa (out_fct_type out, const char *funcname, char *buffer, size_t idx, size_t maxlen, double value, unsigned int prec, unsigned int width, unsigned int flags) |
static size_t | safec_atoa (out_fct_type out, const char *funcname, char *buffer, size_t idx, size_t maxlen, double value, unsigned int prec, unsigned int width, unsigned int flags, const char *format) |
int | safec_vsnprintf_s (out_fct_type out, const char *funcname, char *buffer, const size_t bufsize, const char *format, va_list va) |
int | vsnprintf_s (char *restrict dest, rsize_t dmax, const char *restrict fmt, va_list ap) |
#define PRINTF_NTOA_BUFFER_SIZE 32U |
#define PRINTF_FTOA_BUFFER_SIZE 32U |
#define PRINTF_SUPPORT_FLOAT |
#define PRINTF_SUPPORT_EXPONENTIAL |
#define PRINTF_DEFAULT_FLOAT_PRECISION 6U |
#define PRINTF_MAX_FLOAT 1e9 |
#define PRINTF_SUPPORT_PTRDIFF_T |
#define FLAGS_ZEROPAD (1U << 0U) |
#define FLAGS_LEFT (1U << 1U) |
#define FLAGS_PLUS (1U << 2U) |
#define FLAGS_SPACE (1U << 3U) |
#define FLAGS_HASH (1U << 4U) |
#define FLAGS_UPPERCASE (1U << 5U) |
#define FLAGS_CHAR (1U << 6U) |
#define FLAGS_SHORT (1U << 7U) |
#define FLAGS_LONG (1U << 8U) |
#define FLAGS_LONG_LONG (1U << 9U) |
#define FLAGS_PRECISION (1U << 10U) |
#define FLAGS_ADAPT_EXP (1U << 11U) |
#define FLAGS_LONG_DOUBLE (1U << 12U) |
|
inlinestatic |
|
inlinestatic |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
inlinestatic |
int safec_vsnprintf_s | ( | out_fct_type | out, |
const char * | funcname, | ||
char * | buffer, | ||
const size_t | bufsize, | ||
const char * | format, | ||
va_list | va ) |
int vsnprintf_s | ( | char *restrict | dest, |
rsize_t | dmax, | ||
const char *restrict | fmt, | ||
va_list | ap ) |