(/usr/bin/git)
#include <bits/types/struct_itimerspec.h>
#include <stdbool.h>
#include <stdint.h>
#include <time.h>
Go to the source code of this file.
|
| #define | CO_RANGE(start, test, end) (((start) <= (test)) && ((test) < (end))) |
| |
| #define | CC_RANGE(start, test, end) (((start) <= (test)) && ((test) <= (end))) |
| |
| #define | OC_RANGE(start, test, end) (((start) < (test)) && ((test) <= (end))) |
| |
| #define | OO_RANGE(start, test, end) (((start) < (test)) && ((test) < (end))) |
| |
◆ CC_RANGE
| #define CC_RANGE |
( |
|
start, |
|
|
|
test, |
|
|
|
end |
|
) |
| (((start) <= (test)) && ((test) <= (end))) |
Check if a value is in a closed-closed range (test in [start, end] ) ie start <= test <= end.
- Parameters
-
| start | the lower end of the range to check |
| test | the value to check if it's in range |
| end | the upper end of the range to check |
- Returns
- true if test is higher or equal to start and lower or equal to end
◆ CO_RANGE
| #define CO_RANGE |
( |
|
start, |
|
|
|
test, |
|
|
|
end |
|
) |
| (((start) <= (test)) && ((test) < (end))) |
Check if a value is in a closed-open range (test in [start, end) ) ie start <= test < end.
- Parameters
-
| start | the lower end of the range to check |
| test | the value to check if it's in range |
| end | the upper end of the range to check |
- Returns
- true if test is higher or equal to start and lower then end
◆ OC_RANGE
| #define OC_RANGE |
( |
|
start, |
|
|
|
test, |
|
|
|
end |
|
) |
| (((start) < (test)) && ((test) <= (end))) |
Check if a value is in a open-closed range (test in (start, end] ) ie start < test <= end.
- Parameters
-
| start | the lower end of the range to check |
| test | the value to check if it's in range |
| end | the upper end of the range to check |
- Returns
- true if test is higher then start and lower or equal to end
◆ OO_RANGE
| #define OO_RANGE |
( |
|
start, |
|
|
|
test, |
|
|
|
end |
|
) |
| (((start) < (test)) && ((test) < (end))) |
Check if a value is in a open-open range (test in (start, end) ) ie start < test < end.
- Parameters
-
| start | the lower end of the range to check |
| test | the value to check if it's in range |
| end | the upper end of the range to check |
- Returns
- true if test is higher then start and lower then end
◆ crinitTimer_t
The type of a crinit timer object.
◆ crinitTimerDef_t
The type of a timer definition.
◆ crinitCheckTimerDef()
Check if a timer definition gives a valid timer ie. month between 1 and 12, day in 1 to 31, hours 0 to 23, ...
- Parameters
-
| td | the timer definition to set check |
- Returns
- true if the timer definition is valid, and false if not
◆ crinitCheckTimerTime()
Check if a timerstamp is valid for a timer
- Parameters
-
| ts | the timestamp to check. |
| td | the crinit timer definition to check against |
- Returns
- true if the timer should trigger at that timestamp, false otherwise
◆ crinitPrintTimerDef()
print a crinitTimerDef_t as crinitInfoPrint message
- Parameters
-
| td | the crinitTimerDef_t to print |
◆ crinitSPrintTimerDef()
print a crinitTimerDef_t into a string
- Parameters
-
| s | the string to print to |
| td | the crinitTimerDef_t to print |
- Returns
- the number of bytes written to s excluding the terminating 0 byte
◆ crinitTimerNextTime()
| struct timespec crinitTimerNextTime |
( |
struct timespec * |
last, |
|
|
crinitTimerDef_t * |
td |
|
) |
| |
Calculate the next time the timer should trigger.
- Parameters
-
| last | the last timestamp to calculate the next from |
| td | the timer definition to calculate the next time from |
- Returns
- the timestamp the timer is fullfiled next
◆ crinitTimerParse()
Parses a timer definition from a string
- Parameters
-
| s | the string to parse from |
| td | the crinitTimerDef_t to set |
- Returns
- true on success, false otherwise
◆ crinitTimerSetDefault()
Set a timer to the default value: Mon..Sun-0000..65535-01..12-01..31-00:00:00+0000
- Parameters
-
| td | the crinitTimerDef_t to set to default |
◆ crinitZonedTimeR()
| struct tm * crinitZonedTimeR |
( |
const time_t * |
time, |
|
|
int8_t |
timezone[2], |
|
|
struct tm *restrict |
result |
|
) |
| |
Get a struct tm similar to gmtime_r with a specific timezone.
- Parameters
-
| time | the timestamp to transform into a tm |
| timezone | the timezone with hour and minute |
| result | the resulting tm struct |
- Returns
- a tm representation in the specyfied timezone