Table of Contents
- TIMERS: generally used headers, defines, timers, allocators,...
- Structures
- Functions
- Defines
- Functions Documentation
- function u_sleep
- function start_HiTimer
- function n_time_rfc3339
- function n_time_rfc2822
- function n_time_parse_rfc3339
- function n_time_parse_http_date
- function n_time_http_date
- function get_usec
- function get_sec
- function get_msec
- function PAUSE
- Macros Documentation
TIMERS: generally used headers, defines, timers, allocators,...
Structures
| Name | |
|---|---|
| struct | N_TIME Timing Structure. |
Functions
| Name | |
|---|---|
| void | u_sleep(unsigned int usec) sleep for the given number of microseconds |
| int | start_HiTimer(N_TIME * timer) Init or restart from zero any N_TIME HiTimer. |
| int | n_time_rfc3339(time_t t, long offset, char * out, size_t size) format t as RFC 3339 / ISO 8601 with a numeric offset |
| int | n_time_rfc2822(time_t t, long offset, char * out, size_t size) format t as an RFC 2822 date with a numeric offset, as RSS wants |
| int | n_time_parse_rfc3339(const char * s, size_t len, time_t * t) parse "YYYY-MM-DD[T |
| int | n_time_parse_http_date(const char * s, size_t len, time_t * t) parse an HTTP date in IMF-fixdate form ("Sun, 06 Nov 1994 08:49:37 GMT") |
| int | n_time_http_date(time_t t, char * out, size_t size) format t as an HTTP date (RFC 9110 IMF-fixdate, always GMT) |
| time_t | get_usec(N_TIME * timer) Poll any N_TIME HiTimer, returning usec. |
| time_t | get_sec(N_TIME * timer) Poll any N_TIME HiTimer, returning sec. |
| time_t | get_msec(N_TIME * timer) Poll any N_TIME HiTimer, returning msec. |
| void | PAUSE(void ) for the 'press a key to continue' |
Defines
| Name | |
|---|---|
| N_TIME_RFC3339_LEN buffer size for n_time_rfc3339(): "1970-01-01T00:00:00+00:00" + NUL |
|
| N_TIME_RFC2822_LEN buffer size for n_time_rfc2822(): "Thu, 01 Jan 1970 00:00:00 +0000" + NUL |
|
| N_TIME_HTTP_DATE_LEN buffer size for n_time_http_date(): "Thu, 01 Jan 1970 00:00:00 GMT" + NUL |
Functions Documentation
function u_sleep
void u_sleep(
unsigned int usec
)
sleep for the given number of microseconds
Parameters:
- usec Number of usec to sleep
wrapper around usleep for API consistency
sleep for the given number of microseconds
function start_HiTimer
int start_HiTimer(
N_TIME * timer
)
Init or restart from zero any N_TIME HiTimer.
Parameters:
- timer Any N_TIMER *timer you wanna start or reset
Return: TRUE or FALSE
Initialize or restart from zero any N_TIME HiTimer.
Init or restart from zero any N_TIME HiTimer.
function n_time_rfc3339
int n_time_rfc3339(
time_t t,
long offset,
char * out,
size_t size
)
format t as RFC 3339 / ISO 8601 with a numeric offset
Parameters:
- t seconds since the Unix epoch
- offset offset from UTC in seconds, a multiple of 60, |offset| < 86400
- out destination, at least N_TIME_RFC3339_LEN bytes
- size size of out
- t seconds since the Unix epoch
- offset offset from UTC in seconds, a multiple of 60, |offset| < 86400
- out destination, at least N_TIME_RFC3339_LEN bytes
- size size of out
Return:
- TRUE, or FALSE on a bad argument
- TRUE, or FALSE on a bad argument
format t as RFC 3339 at offset seconds east of UTC ("+00:00" for UTC)
"1970-01-01T01:00:00+01:00" (PHP's date('c') for that zone; offset 0 gives "+00:00", not "Z"). format t as RFC 3339 / ISO 8601 with a numeric offset
function n_time_rfc2822
int n_time_rfc2822(
time_t t,
long offset,
char * out,
size_t size
)
format t as an RFC 2822 date with a numeric offset, as RSS wants
Parameters:
- t seconds since the Unix epoch
- offset offset from UTC in seconds, a multiple of 60, |offset| < 86400
- out destination, at least N_TIME_RFC2822_LEN bytes
- size size of out
- t seconds since the Unix epoch
- offset offset from UTC in seconds, a multiple of 60, |offset| < 86400
- out destination, at least N_TIME_RFC2822_LEN bytes
- size size of out
Return:
- TRUE, or FALSE on a bad argument
- TRUE, or FALSE on a bad argument
format t as an RFC 2822 date at offset seconds east of UTC
"Thu, 01 Jan 1970 01:00:00 +0100": the local time at offset seconds east of UTC (PHP's date(DATE_RSS) output for that zone).
format t as an RFC 2822 date with a numeric offset, as RSS wants
function n_time_parse_rfc3339
int n_time_parse_rfc3339(
const char * s,
size_t len,
time_t * t
)
parse "YYYY-MM-DD[T| ]HH:MM:SS[Z|+hh:mm|-hh:mm]"
Parameters:
- s the text (may be NULL only when len is 0)
- len its length
- t receives seconds since the Unix epoch
- s the text (may be NULL only when len is 0)
- len its length
- t receives seconds since the Unix epoch
Return:
- TRUE on success, FALSE otherwise
- TRUE on success, FALSE otherwise
parse "YYYY-MM-DD[T| ]HH:MM:SS[Z|+hh:mm|-hh:mm]" (UTC without a zone)
RFC 3339 timestamps, and the SQL "YYYY-MM-DD HH:MM:SS" form; without a zone the time is UTC. No fractional seconds. Calendar values checked. parse "YYYY-MM-DD[T| ]HH:MM:SS[Z|+hh:mm|-hh:mm]"
function n_time_parse_http_date
int n_time_parse_http_date(
const char * s,
size_t len,
time_t * t
)
parse an HTTP date in IMF-fixdate form ("Sun, 06 Nov 1994 08:49:37 GMT")
Parameters:
- s the text (may be NULL only when len is 0)
- len its length
- t receives seconds since the Unix epoch
- s the text (may be NULL only when len is 0)
- len its length
- t receives seconds since the Unix epoch
Return:
- TRUE on success, FALSE otherwise
- TRUE on success, FALSE otherwise
parse an IMF-fixdate HTTP date strictly
Strict: exactly that shape, a weekday that matches the date, real calendar values (no Feb 30, no hour 24, no leap second). The obsolete RFC 850 and asctime forms are refused; a caller handling If-Modified-Since then just ignores the header, which is always safe. parse an HTTP date in IMF-fixdate form ("Sun, 06 Nov 1994 08:49:37 GMT")
function n_time_http_date
int n_time_http_date(
time_t t,
char * out,
size_t size
)
format t as an HTTP date (RFC 9110 IMF-fixdate, always GMT)
Parameters:
- t seconds since the Unix epoch
- out destination, at least N_TIME_HTTP_DATE_LEN bytes
- size size of out
- t seconds since the Unix epoch
- out destination, at least N_TIME_HTTP_DATE_LEN bytes
- size size of out
Return:
- TRUE, or FALSE when out is NULL / too small or t out of range
- TRUE, or FALSE when out is NULL / too small or t out of range
For Date, Last-Modified and Expires. Pure calendar arithmetic: no locale, no TZ, no gmtime(), the same result on every platform. Years 1 to 9999.
function get_usec
time_t get_usec(
N_TIME * timer
)
Poll any N_TIME HiTimer, returning usec.
Parameters:
- timer Any N_TIMER *timer you wanna poll
Return: The elapsed number of usec for the given N_TIME *timer
Poll any N_TIME HiTimer, returning usec, and moving currentTime to startTime.
Poll any N_TIME HiTimer, returning usec.
function get_sec
time_t get_sec(
N_TIME * timer
)
Poll any N_TIME HiTimer, returning sec.
Parameters:
- timer Any N_TIMER *timer you wanna poll
Return: The elapsed number of sec for the given N_TIME *timer
Poll any N_TIME HiTimer, returning sec, and moving currentTime to startTime.
Poll any N_TIME HiTimer, returning sec.
function get_msec
time_t get_msec(
N_TIME * timer
)
Poll any N_TIME HiTimer, returning msec.
Parameters:
- timer Any N_TIMER *timer you wanna poll
Return: The elapsed number of msec for the given N_TIME *timer
Poll any N_TIME HiTimer, returning msec, and moving currentTime to startTime.
Poll any N_TIME HiTimer, returning msec.
function PAUSE
void PAUSE(
void
)
for the 'press a key to continue'
make a pause in a terminal
for the 'press a key to continue'
Macros Documentation
define N_TIME_RFC3339_LEN
#define N_TIME_RFC3339_LEN 26
buffer size for n_time_rfc3339(): "1970-01-01T00:00:00+00:00" + NUL
define N_TIME_RFC2822_LEN
#define N_TIME_RFC2822_LEN 32
buffer size for n_time_rfc2822(): "Thu, 01 Jan 1970 00:00:00 +0000" + NUL
define N_TIME_HTTP_DATE_LEN
#define N_TIME_HTTP_DATE_LEN 30
buffer size for n_time_http_date(): "Thu, 01 Jan 1970 00:00:00 GMT" + NUL
Modules
- AABB3D
- ACCEPT_POOL
- ALLEGRO4
- ALLEGRO5
- ANIM_LIB
- ASTAR
- ATLAS_LIB
- AVRO
- CLOCK_SYNC
- COMMONS
- CONFIGFILE
- CYPHER_BASE64
- CYPHER_VIGENERE
- DEAD_RECKONING
- ENUMS
- EXCEPTIONS
- GAME_ENV
- GIT
- GUI
- HASH_TABLE
- ISOMETRIC_ENGINE
- LIST
- LOG
- LOGNODUP
- LZ4
- NETWORKING
- NETWORK_MSG
- N_COOKIES
- N_DIFF
- N_DIGEST
- N_DISK_CACHE
- N_DNS
- N_ECC
- N_ENTROPY
- N_FILES
- N_FLUIDS
- N_GUI_COLOR
- N_GUI_COLORWHEEL
- N_GUI_CURVE
- N_GUI_GRID
- N_GUI_POPUP
- N_HEX
- N_HTTP3
- N_HTTP_COOKIE
- N_HTTP_FORM
- N_HTTP_MIME
- N_HTTP_REQ
- N_HTTP_RESP
- N_HTTP_ROUTER
- N_HTTP_SERVER
- N_ICC
- N_JSON
- N_KAFKA
- N_LINALG
- N_MODULE
- N_OPENSSL_COMPAT
- N_PRETTY
- N_PTH
- N_QUERY
- N_RANDOM
- N_SHA256
- N_STR
- N_TIFF
- N_TIME
- N_USER
- N_X509
- N_ZIP
- PARTICLES
- PCRE
- PHYSICS
- SIGNALS
- STACK
- THREADS
- TRAJECTORY
- TREE
- ZLIB