Objectively
Ultra-lightweight object oriented framework for GNU C.
Loading...
Searching...
No Matches
Date.h File Reference

Microsecond-precision immutable dates. More...

#include <time.h>
#include <sys/time.h>
#include <Objectively/Object.h>

Go to the source code of this file.

Data Structures

struct  Date
 Microsecond-precision immutable dates. More...
 

Macros

#define SEC_PER_DAY   (60 * 60 * 24)
 Seconds per day.
 
#define USEC_PER_SEC   1000000
 Microseconds per second.
 

Typedefs

typedef struct timeval Time
 Time (seconds and microseconds).
 

Functions

OBJECTIVELY_EXPORT Class_Date (void)
 

Detailed Description

Microsecond-precision immutable dates.

Definition in file Date.h.

Macro Definition Documentation

◆ SEC_PER_DAY

#define SEC_PER_DAY   (60 * 60 * 24)

Seconds per day.

Definition at line 58 of file Date.h.

◆ USEC_PER_SEC

#define USEC_PER_SEC   1000000

Microseconds per second.

Definition at line 51 of file Date.h.

Typedef Documentation

◆ Time

typedef struct timeval Time

Time (seconds and microseconds).

Definition at line 64 of file Date.h.

Function Documentation

◆ _Date()

OBJECTIVELY_EXPORT Class * _Date ( void  )

Definition at line 222 of file Date.c.

222 {
223 static Class *clazz;
224 static Once once;
225
226 do_once(&once, {
227 clazz = _initialize(&(const ClassDef) {
228 .name = "Date",
229 .superclass = _Object(),
230 .instanceSize = sizeof(Date),
231 .interfaceOffset = offsetof(Date, interface),
232 .interfaceSize = sizeof(DateInterface),
234 });
235 });
236
237 return clazz;
238}
Class * _initialize(const ClassDef *def)
Initializes the given Class.
Definition Class.c:86
static void initialize(Class *clazz)
Definition Date.c:203
Class * _Object(void)
Definition Object.c:136
long Once
The Once type.
Definition Once.h:37
#define do_once(once, block)
Executes the given block at most one time.
Definition Once.h:43
ClassDefs are passed to _initialize via an archetype to initialize a Class.
Definition Class.h:41
The runtime representation of a Class.
Definition Class.h:95
Microsecond-precision immutable dates.
Definition Date.h:74