Objectively 1.0.0
Ultra-lightweight object oriented framework for GNU C.
Data Structures | Macros | Typedefs | Functions
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 MSEC_PER_SEC   1000000
 Microseconds per second. More...
 
#define SEC_PER_DAY   (60 * 60 * 24)
 Seconds per day. More...
 

Typedefs

typedef struct timeval Time
 Time (seconds and microseconds). More...
 

Functions

OBJECTIVELY_EXPORT Class_Date (void)
 

Detailed Description

Microsecond-precision immutable dates.

Definition in file Date.h.

Macro Definition Documentation

◆ MSEC_PER_SEC

#define MSEC_PER_SEC   1000000

Microseconds per second.

Definition at line 50 of file Date.h.

◆ SEC_PER_DAY

#define SEC_PER_DAY   (60 * 60 * 24)

Seconds per day.

Definition at line 55 of file Date.h.

Typedef Documentation

◆ Time

typedef struct timeval Time

Time (seconds and microseconds).

Definition at line 60 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:91
static void initialize(Class *clazz)
Definition: Date.c:203
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:70
Class * _Object(void)
The Object archetype.
Definition: Object.c:136