77 const long seconds = self->
time.tv_sec - other->
time.tv_sec;
80 const long microseconds = self->
time.tv_usec - other->
time.tv_usec;
81 if (microseconds == 0) {
112 date->
time.tv_sec += interval->tv_sec;
113 date->
time.tv_usec += interval->tv_usec;
117 }
else if (
date->
time.tv_usec < 0) {
146 gettimeofday(&self->
time, NULL);
186 .tv_sec = self->
time.tv_sec - time->tv_sec,
187 .tv_usec = self->
time.tv_usec - time->tv_usec
190 if (delta.tv_usec < 0) {
198#pragma mark - Class lifecycle
230 .instanceSize =
sizeof(
Date),
231 .interfaceOffset = offsetof(
Date, interface),
232 .interfaceSize =
sizeof(DateInterface),
ident release(ident obj)
Atomically decrement the given Object's reference count. If the resulting reference count is 0,...
Class * _initialize(const ClassDef *def)
Initializes the given Class.
#define alloc(type)
Allocate and initialize and instance of type.
#define super(type, obj, method,...)
static void initialize(Class *clazz)
Microsecond-precision immutable dates.
#define MSEC_PER_SEC
Microseconds per second.
struct timeval Time
Time (seconds and microseconds).
int HashForInteger(int hash, const long integer)
Accumulates the hash value of integer into hash.
Utilities for calculating hash values.
#define HASH_SEED
The hash seed value.
Order
Comparison constants.
#define do_once(once, block)
Executes the given block at most one time.
ClassDefs are passed to _initialize via an archetype to initialize a Class.
The runtime representation of a Class.
ident interface
The interface of the Class.
Condition * init(Condition *self)
Initializes this Condition.
Microsecond-precision immutable dates.
Date * dateWithTimeSinceNow(const Time interval)
Returns a new Date with the given Time since now.
Time timeSinceTime(const Date *self, const Time *time)
Time timeSinceNow(const Date *self)
Order compareTo(const Date *self, const Date *other)
Compares this Date to another.
Time timeSinceDate(const Date *self, const Date *date)
Date * initWithTime(Date *self, const Time *time)
Class * _Date(void)
The Date archetype.
Date * date(void)
Returns a new Date with the current Time.
Object is the root Class of The Objectively Class hierarchy.
Class * _Object(void)
The Object archetype.
_Bool isKindOfClass(const Object *self, const Class *clazz)
Tests for Class hierarchy membership.
_Bool isEqual(const Object *self, const Object *other)
Tests equality of the other Object.
int hash(const Object *self)