WebRadioApp  0.1
calend.c File Reference

Calendar. More...

#include "calend.h"
#include "inttypes.h"
Include dependency graph for calend.c:

Macros

#define SECS_PER_HOUR   (60L * 60L)
 
#define SECS_PER_DAY   (SECS_PER_HOUR * 24L)
 
#define __isleap(year)   ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
 
#define DIV(a, b)   ((a) / (b) - ((a) % (b) < 0))
 
#define LEAPS_THRU_END_OF(y)   (DIV(y, 4) - DIV(y, 100) + DIV(y, 400))
 

Functions

char istEinSchaltjahr (const int uJahr)
 Die Regel lautet: Alles, was durch 4 teilbar ist, ist ein Schaltjahr. Es sei denn, das Jahr ist durch 100 teilbar, dann ist es keins. Aber wenn es durch 400 teilbar ist, ist es doch wieder eins. More...
 
int getAnzahlTageImMonat (const int uMonat, const int uJahr)
 
int getAnzahlTageImJahr (const int uJahr)
 
int getWochentag (const int uTag, const int uMonat, const int uJahr)
 
int getTagDesJahres (const int uTag, const int uMonat, const int uJahr)
 
char getKalenderwoche (const int uTag, const int uMonat, const int uJahr)
 
int offtime (int64_t *t, long int offset, struct tm *tp)
 

Variables

const int arrTageImMonat [13]
 
const int arrMonatsOffset [13] = {0, 1, 4, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5}
 

Detailed Description

Calendar.

Author
Alois Knoll
Version
0.1
Date
2021-03-25

Macro Definition Documentation

◆ __isleap

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

◆ DIV

#define DIV (   a,
 
)    ((a) / (b) - ((a) % (b) < 0))

◆ LEAPS_THRU_END_OF

#define LEAPS_THRU_END_OF (   y)    (DIV(y, 4) - DIV(y, 100) + DIV(y, 400))

◆ SECS_PER_DAY

#define SECS_PER_DAY   (SECS_PER_HOUR * 24L)

◆ SECS_PER_HOUR

#define SECS_PER_HOUR   (60L * 60L)