dhcpd-pools  2.28
ISC dhcpd lease usage analyser
Macros | Functions
strftime.c File Reference
#include <config.h>
#include "strftime.h"
#include "time-internal.h"
#include <ctype.h>
#include <time.h>
#include <limits.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
Include dependency graph for strftime.c:

Macros

#define MULTIBYTE_IS_FORMAT_SAFE   1
 
#define DO_MULTIBYTE   (! MULTIBYTE_IS_FORMAT_SAFE)
 
#define CHAR_T   char
 
#define UCHAR_T   unsigned char
 
#define L_(Str)   Str
 
#define NLW(Sym)   Sym
 
#define MEMCPY(d, s, n)   memcpy (d, s, n)
 
#define STRLEN(s)   strlen (s)
 
#define SHR(a, b)
 
#define INT_STRLEN_BOUND(t)   ((sizeof (t) * CHAR_BIT - 1) * 146 / 485 + 2)
 
#define TM_YEAR_BASE   1900
 
#define __isleap(year)   ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
 
#define FPRINTFTIME   0
 
#define STREAM_OR_CHAR_T   CHAR_T
 
#define STRFTIME_ARG(x)   x,
 
#define memset_space(P, Len)   (memset (P, ' ', Len), (P) += (Len))
 
#define memset_zero(P, Len)   (memset (P, '0', Len), (P) += (Len))
 
#define advance(P, N)   ((P) += (N))
 
#define add(n, f)
 
#define add1(C)   add (1, *p = C)
 
#define cpy(n, s)
 
#define LOCALE_PARAM_PROTO
 
#define LOCALE_ARG
 
#define HELPER_LOCALE_ARG
 
#define TOUPPER(Ch, L)   toupper (Ch)
 
#define TOLOWER(Ch, L)   tolower (Ch)
 
#define ISDIGIT(Ch)   ((unsigned int) (Ch) - L_('0') <= 9)
 
#define tm_diff   ftime_tm_diff
 
#define ISO_WEEK_START_WDAY   1 /* Monday */
 
#define ISO_WEEK1_WDAY   4 /* Thursday */
 
#define YDAY_MINIMUM   (-366)
 
#define my_strftime   strftime
 
#define nl_get_alt_digit   _nl_get_alt_digit
 
#define extra_args
 
#define extra_args_spec
 
#define tz   1
 
#define ns   0
 
#define DO_NUMBER(d, v)
 
#define DO_SIGNED_NUMBER(d, negative, v)
 
#define DO_TZ_OFFSET(d, negative, mask, v)
 
#define DO_NUMBER_SPACEPAD(d, v)
 

Functions

static CHAR_Tmemcpy_lowcase (CHAR_T *dest, const CHAR_T *src, size_t len LOCALE_PARAM_PROTO)
 
static CHAR_Tmemcpy_uppcase (CHAR_T *dest, const CHAR_T *src, size_t len LOCALE_PARAM_PROTO)
 
static int tm_diff (const struct tm *a, const struct tm *b)
 
static int iso_week_days (int yday, int wday)
 
static size_t strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s, const CHAR_T *format, const struct tm *tp extra_args_spec LOCALE_PARAM_PROTO)
 
size_t my_strftime (STREAM_OR_CHAR_T *s, STRFTIME_ARG(size_t maxsize) const CHAR_T *format, const struct tm *tp extra_args_spec LOCALE_PARAM_PROTO)
 

Macro Definition Documentation

#define __isleap (   year)    ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))

Referenced by strftime_case_().

#define add (   n,
 
)
Value:
do \
{ \
size_t _n = (n); \
size_t _w = (width < 0 ? 0 : width); \
size_t _incr = _n < _w ? _w : _n; \
if (_incr >= maxsize - i) \
return 0; \
if (p) \
{ \
if (digits == 0 && _n < _w) \
{ \
size_t _delta = width - _n; \
if (pad == L_('0')) \
memset_zero (p, _delta); \
memset_space (p, _delta); \
} \
f; \
advance (p, _n); \
} \
i += _incr; \
} while (0)
#define memset_space(P, Len)
Definition: strftime.c:151
#define L_(Str)
Definition: strftime.c:84

Referenced by strftime_case_().

#define add1 (   C)    add (1, *p = C)

Referenced by strftime_case_().

#define advance (   P,
 
)    ((P) += (N))
#define CHAR_T   char

Referenced by strftime_case_().

#define cpy (   n,
 
)
Value:
add ((n), \
if (to_lowcase) \
memcpy_lowcase (p, (s), _n LOCALE_ARG); \
else if (to_uppcase) \
memcpy_uppcase (p, (s), _n LOCALE_ARG); \
MEMCPY ((void *) p, (void const *) (s), _n))
#define LOCALE_ARG
Definition: strftime.c:255
static CHAR_T * memcpy_lowcase(CHAR_T *dest, const CHAR_T *src, size_t len LOCALE_PARAM_PROTO)
Definition: strftime.c:308
static CHAR_T * memcpy_uppcase(CHAR_T *dest, const CHAR_T *src, size_t len LOCALE_PARAM_PROTO)
Definition: strftime.c:317
#define add(n, f)
Definition: strftime.c:161
#define MEMCPY(d, s, n)
Definition: strftime.c:87

Referenced by strftime_case_().

#define DO_MULTIBYTE   (! MULTIBYTE_IS_FORMAT_SAFE)
#define DO_NUMBER (   d,
 
)
Value:
do \
{ \
digits = d; \
number_value = v; \
goto do_number; \
} \
while (0)

Referenced by strftime_case_().

#define DO_NUMBER_SPACEPAD (   d,
 
)
Value:
do \
{ \
digits = d; \
number_value = v; \
goto do_number_spacepad; \
} \
while (0)

Referenced by strftime_case_().

#define DO_SIGNED_NUMBER (   d,
  negative,
 
)
Value:
do \
{ \
digits = d; \
negative_number = negative; \
u_number_value = v; \
goto do_signed_number; \
} \
while (0)

Referenced by strftime_case_().

#define DO_TZ_OFFSET (   d,
  negative,
  mask,
 
)
Value:
do \
{ \
digits = d; \
negative_number = negative; \
tz_colon_mask = mask; \
u_number_value = v; \
goto do_tz_offset; \
} \
while (0)

Referenced by strftime_case_().

#define extra_args

Referenced by my_strftime(), and strftime_case_().

#define extra_args_spec
#define FPRINTFTIME   0
#define HELPER_LOCALE_ARG

Referenced by strftime_case_().

#define INT_STRLEN_BOUND (   t)    ((sizeof (t) * CHAR_BIT - 1) * 146 / 485 + 2)

Referenced by strftime_case_().

#define ISDIGIT (   Ch)    ((unsigned int) (Ch) - L_('0') <= 9)

Referenced by strftime_case_().

#define ISO_WEEK1_WDAY   4 /* Thursday */

Referenced by iso_week_days().

#define ISO_WEEK_START_WDAY   1 /* Monday */

Referenced by iso_week_days().

#define L_ (   Str)    Str

Referenced by strftime_case_().

#define LOCALE_ARG

Referenced by my_strftime(), and strftime_case_().

#define LOCALE_PARAM_PROTO
#define MEMCPY (   d,
  s,
 
)    memcpy (d, s, n)
#define memset_space (   P,
  Len 
)    (memset (P, ' ', Len), (P) += (Len))

Referenced by strftime_case_().

#define memset_zero (   P,
  Len 
)    (memset (P, '0', Len), (P) += (Len))

Referenced by strftime_case_().

#define MULTIBYTE_IS_FORMAT_SAFE   1
#define my_strftime   strftime
#define nl_get_alt_digit   _nl_get_alt_digit

Referenced by strftime_case_().

#define NLW (   Sym)    Sym

Referenced by strftime_case_().

#define ns   0

Referenced by strftime_case_().

#define SHR (   a,
 
)
Value:
(-1 >> 1 == -1 \
? (a) >> (b) \
: (a) / (1 << (b)) - ((a) % (1 << (b)) < 0))

Referenced by tm_diff().

#define STREAM_OR_CHAR_T   CHAR_T

Referenced by strftime_case_().

#define STRFTIME_ARG (   x)    x,

Referenced by my_strftime(), and strftime_case_().

#define STRLEN (   s)    strlen (s)

Referenced by strftime_case_().

#define tm_diff   ftime_tm_diff

Referenced by strftime_case_().

#define TM_YEAR_BASE   1900

Referenced by strftime_case_(), and tm_diff().

#define TOLOWER (   Ch,
 
)    tolower (Ch)

Referenced by memcpy_lowcase().

#define TOUPPER (   Ch,
 
)    toupper (Ch)

Referenced by memcpy_uppcase().

#define tz   1

Referenced by strftime_case_(), and tzalloc().

#define UCHAR_T   unsigned char

Referenced by memcpy_lowcase(), and memcpy_uppcase().

#define YDAY_MINIMUM   (-366)

Referenced by iso_week_days().

Function Documentation

static int iso_week_days ( int  yday,
int  wday 
)
static

Referenced by strftime_case_().

static CHAR_T* memcpy_lowcase ( CHAR_T dest,
const CHAR_T src,
size_t len  LOCALE_PARAM_PROTO 
)
static
static CHAR_T* memcpy_uppcase ( CHAR_T dest,
const CHAR_T src,
size_t len  LOCALE_PARAM_PROTO 
)
static
size_t my_strftime ( STREAM_OR_CHAR_T s,
STRFTIME_ARG(size_t maxsize) const CHAR_T format,
const struct tm *tp extra_args_spec  LOCALE_PARAM_PROTO 
)

Here is the call graph for this function:

static size_t strftime_case_ ( bool  upcase,
STREAM_OR_CHAR_T s,
const CHAR_T format,
const struct tm *tp extra_args_spec  LOCALE_PARAM_PROTO 
)
static

Referenced by my_strftime().

Here is the call graph for this function:

static int tm_diff ( const struct tm *  a,
const struct tm *  b 
)
static