Go to the source code of this file.
Classes | |
| struct | ClockTime |
| Class or struct representing a time as seen on a clock. More... | |
Macros | |
| #define | ClockTime_create(...) |
| Create a new ClockTime from either an hour (1 argument), an hour and a minute (2 arguments), an hour/minute/second (3 arguments), or an hour/minute/second/nanosecond (4 arguments). More... | |
| #define | ClockTime_ptr_create(result,...) |
| Create a new ClockTime from either an hour (2 arguments), an hour and a minute (3 arguments), an hour/minute/second (4 arguments), or an hour/minute/second/nanosecond (5 arguments). More... | |
Functions | |
| struct ClockTime | ClockTime_from_hour (int_hour hour) |
| Create a new ClockTime based on an hour of the day. More... | |
| void | ClockTime_ptr_from_hour (struct ClockTime *const result, int_hour hour) |
| Create a new ClockTime based on an hour of the day. More... | |
| struct ClockTime | ClockTime_from_hour_minute (int_hour hour, int_minute minute) |
| Create a new ClockTime based on an hour and a minute. More... | |
| void | ClockTime_ptr_from_hour_minute (struct ClockTime *const result, int_hour hour, int_minute minute) |
| Create a new ClockTime based on an hour and a minute. More... | |
| struct ClockTime | ClockTime_from_hour_minute_second (int_hour hour, int_minute minute, int_second second) |
| Create a new ClockTime based on an hour, a minute, and a second. More... | |
| void | ClockTime_ptr_from_hour_minute_second (struct ClockTime *const result, int_hour hour, int_minute minute, int_second second) |
| Create a new ClockTime based on an hour, a minute, and a second. More... | |
| struct ClockTime | ClockTime_from_hour_minute_second_nanosecond (int_hour hour, int_minute minute, int_second second, int_nanosecond nanosecond) |
| Create a new ClockTime based on an hour, a minute, a second, and a nanosecond. More... | |
| void | ClockTime_ptr_from_hour_minute_second_nanosecond (struct ClockTime *const result, int_hour hour, int_minute minute, int_second second, int_nanosecond nanosecond) |
| Create a new ClockTime based on an hour, a minute, a second, and a nanosecond. More... | |
| struct ClockTime | ClockTime_create_with_decimal_seconds (int_hour hour, int_minute minute, double second) |
| Create a new ClockTime based on an hour, a minute, and a decimal second. More... | |
| void | ClockTime_ptr_create_with_decimal_seconds (struct ClockTime *const result, int_hour hour, int_minute minute, double second) |
| Create a new ClockTime based on an hour, a minute, and a decimal second. More... | |
| struct ClockTime | ClockTime_midnight (void) |
| Create a new ClockTime initialized to midnight (00:00). More... | |
| void | ClockTime_ptr_midnight (struct ClockTime *const result) |
| Create a new ClockTime initialized to midnight (00:00). More... | |
| struct ClockTime | ClockTime_noon (void) |
| Create a new ClockTime initialized to noon (12:00). More... | |
| void | ClockTime_ptr_noon (struct ClockTime *const result) |
| Create a new ClockTime initialized to noon (12:00). More... | |
| int_hour | ClockTime_hour (const struct ClockTime *const self) |
| Get the hour component of a ClockTime (0 to 23, inclusive). More... | |
| int_minute | ClockTime_minute (const struct ClockTime *const self) |
| Get the minute component of a ClockTime (0 to 59, inclusive). More... | |
| int_second | ClockTime_second (const struct ClockTime *const self) |
| Get the second component of a ClockTime (0 to 59, inclusive). More... | |
| int_nanosecond | ClockTime_nanosecond (const struct ClockTime *const self) |
| Get the nanosecond component of a ClockTime (less than 10^9, the number of nanoseconds in a second). More... | |
| double | ClockTime_second_decimal (const struct ClockTime *const self) |
| Get the second component of a ClockTime as a decimal, based on both the second and nanosecond components. More... | |
| struct TimeDelta | ClockTime_time_since_midnight (const struct ClockTime *const self) |
| Get a TimeDelta with the time since midnight of a ClockTime. More... | |
| void | ClockTime_add_TimeDelta (struct ClockTime *const self, const struct TimeDelta *const delta) |
| Add a TimeDelta to a ClockTime. More... | |
| void | ClockTime_subtract_TimeDelta (struct ClockTime *const self, const struct TimeDelta *const delta) |
| Subtract a TimeDelta from a ClockTime. More... | |
| short | ClockTime_compare (const struct ClockTime *const lhs, const struct ClockTime *const rhs) |
| Compare two ClockTime instances. More... | |
| present_bool | ClockTime_equal (const struct ClockTime *const lhs, const struct ClockTime *const rhs) |
| Determine whether two ClockTime instances are equal (lhs == rhs). More... | |
| present_bool | ClockTime_less_than (const struct ClockTime *const lhs, const struct ClockTime *const rhs) |
| Determine whether a ClockTime is earlier than another ClockTime (lhs < rhs). More... | |
| present_bool | ClockTime_less_than_or_equal (const struct ClockTime *const lhs, const struct ClockTime *const rhs) |
| Determine whether a ClockTime is earlier than or or the same as another ClockTime (lhs <= rhs). More... | |
| present_bool | ClockTime_greater_than (const struct ClockTime *const lhs, const struct ClockTime *const rhs) |
| Determine whether a ClockTime is later than another ClockTime (lhs > rhs). More... | |
| present_bool | ClockTime_greater_than_or_equal (const struct ClockTime *const lhs, const struct ClockTime *const rhs) |
| Determine whether a ClockTime is later than or the same as another ClockTime (lhs >= rhs). More... | |
| #define ClockTime_create | ( | ... | ) |
Create a new ClockTime from either an hour (1 argument), an hour and a minute (2 arguments), an hour/minute/second (3 arguments), or an hour/minute/second/nanosecond (4 arguments).
has_error field on the returned struct is true.If has_error is true, then at least one of the fields in the errors struct will also be true.
| #define ClockTime_ptr_create | ( | result, | |
| ... | |||
| ) |
Create a new ClockTime from either an hour (2 arguments), an hour and a minute (3 arguments), an hour/minute/second (4 arguments), or an hour/minute/second/nanosecond (5 arguments).
The first argument is a pointer to a struct ClockTime for the result.
has_error field on the returned struct is true.If has_error is true, then at least one of the fields in the errors struct will also be true.
Create a new ClockTime based on an hour of the day.
If the hour is out of range, the ClockTime will have has_error and errors set.
has_error field on the returned struct is true.If has_error is true, then at least one of the fields in the errors struct will also be true.
| hour | The hour of the day (0 to 23, inclusive). |
Create a new ClockTime based on an hour of the day.
If the hour is out of range, the ClockTime will have has_error and errors set.
has_error field on the returned struct is true.If has_error is true, then at least one of the fields in the errors struct will also be true.
| hour | The hour of the day (0 to 23, inclusive). | |
| [out] | result | A pointer to a struct ClockTime for the result. |
| struct ClockTime ClockTime_from_hour_minute | ( | int_hour | hour, |
| int_minute | minute | ||
| ) |
Create a new ClockTime based on an hour and a minute.
If the hour or the minute is out of range, the ClockTime will have has_error and errors set.
has_error field on the returned struct is true.If has_error is true, then at least one of the fields in the errors struct will also be true.
| hour | The hour of the day (0 to 23, inclusive). |
| minute | The minute of the hour (0 to 59, inclusive). |
| void ClockTime_ptr_from_hour_minute | ( | struct ClockTime *const | result, |
| int_hour | hour, | ||
| int_minute | minute | ||
| ) |
Create a new ClockTime based on an hour and a minute.
If the hour or the minute is out of range, the ClockTime will have has_error and errors set.
has_error field on the returned struct is true.If has_error is true, then at least one of the fields in the errors struct will also be true.
| hour | The hour of the day (0 to 23, inclusive). | |
| minute | The minute of the hour (0 to 59, inclusive). | |
| [out] | result | A pointer to a struct ClockTime for the result. |
| struct ClockTime ClockTime_from_hour_minute_second | ( | int_hour | hour, |
| int_minute | minute, | ||
| int_second | second | ||
| ) |
Create a new ClockTime based on an hour, a minute, and a second.
If the hour, the minute, or the second is out of range, the ClockTime will have has_error and errors set.
has_error field on the returned struct is true.If has_error is true, then at least one of the fields in the errors struct will also be true.
| hour | The hour of the day (0 to 23, inclusive). |
| minute | The minute of the hour (0 to 59, inclusive). |
| second | The second of the minute (0 to 59, inclusive, or possibly 60 in the case of a leap second). |
| void ClockTime_ptr_from_hour_minute_second | ( | struct ClockTime *const | result, |
| int_hour | hour, | ||
| int_minute | minute, | ||
| int_second | second | ||
| ) |
Create a new ClockTime based on an hour, a minute, and a second.
If the hour, the minute, or the second is out of range, the ClockTime will have has_error and errors set.
has_error field on the returned struct is true.If has_error is true, then at least one of the fields in the errors struct will also be true.
| hour | The hour of the day (0 to 23, inclusive). | |
| minute | The minute of the hour (0 to 59, inclusive). | |
| second | The second of the minute (0 to 59, inclusive, or possibly 60 in the case of a leap second). | |
| [out] | result | A pointer to a struct ClockTime for the result. |
| struct ClockTime ClockTime_from_hour_minute_second_nanosecond | ( | int_hour | hour, |
| int_minute | minute, | ||
| int_second | second, | ||
| int_nanosecond | nanosecond | ||
| ) |
Create a new ClockTime based on an hour, a minute, a second, and a nanosecond.
If the hour, minute, second, or nanosecond is out of range, the ClockTime will have has_error and errors set.
has_error field on the returned struct is true.If has_error is true, then at least one of the fields in the errors struct will also be true.
| hour | The hour of the day (0 to 23, inclusive). |
| minute | The minute of the hour (0 to 59, inclusive). |
| second | The second of the minute (0 to 59, inclusive, or possibly 60 in the case of a leap second). |
| nanosecond | The nanosecond (0 to 10^9-1, inclusive, i.e. no bigger than the number of nanoseconds in a second). |
| void ClockTime_ptr_from_hour_minute_second_nanosecond | ( | struct ClockTime *const | result, |
| int_hour | hour, | ||
| int_minute | minute, | ||
| int_second | second, | ||
| int_nanosecond | nanosecond | ||
| ) |
Create a new ClockTime based on an hour, a minute, a second, and a nanosecond.
If the hour, minute, second, or nanosecond is out of range, the ClockTime will have has_error and errors set.
has_error field on the returned struct is true.If has_error is true, then at least one of the fields in the errors struct will also be true.
| hour | The hour of the day (0 to 23, inclusive). | |
| minute | The minute of the hour (0 to 59, inclusive). | |
| second | The second of the minute (0 to 59, inclusive, or possibly 60 in the case of a leap second). | |
| nanosecond | The nanosecond (0 to 10^9-1, inclusive, i.e. no bigger than the number of nanoseconds in a second). | |
| [out] | result | A pointer to a struct ClockTime for the result. |
| struct ClockTime ClockTime_create_with_decimal_seconds | ( | int_hour | hour, |
| int_minute | minute, | ||
| double | second | ||
| ) |
Create a new ClockTime based on an hour, a minute, and a decimal second.
has_error field on the returned struct is true.If has_error is true, then at least one of the fields in the errors struct will also be true.
| hour | The hour of the day (0 to 23, inclusive). |
| minute | The minute of the hour (0 to 59, inclusive). |
| second | The second of the minute (0 up to, but not including, 60). |
| void ClockTime_ptr_create_with_decimal_seconds | ( | struct ClockTime *const | result, |
| int_hour | hour, | ||
| int_minute | minute, | ||
| double | second | ||
| ) |
Create a new ClockTime based on an hour, a minute, and a decimal second.
has_error field on the returned struct is true.If has_error is true, then at least one of the fields in the errors struct will also be true.
| hour | The hour of the day (0 to 23, inclusive). | |
| minute | The minute of the hour (0 to 59, inclusive). | |
| second | The second of the minute (0 up to, but not including, 60). | |
| [out] | result | A pointer to a struct ClockTime for the result. |
| struct ClockTime ClockTime_midnight | ( | void | ) |
Create a new ClockTime initialized to midnight (00:00).
| void ClockTime_ptr_midnight | ( | struct ClockTime *const | result | ) |
| void ClockTime_ptr_noon | ( | struct ClockTime *const | result | ) |
Get the hour component of a ClockTime (0 to 23, inclusive).
| int_minute ClockTime_minute | ( | const struct ClockTime *const | self | ) |
Get the minute component of a ClockTime (0 to 59, inclusive).
| int_second ClockTime_second | ( | const struct ClockTime *const | self | ) |
Get the second component of a ClockTime (0 to 59, inclusive).
| int_nanosecond ClockTime_nanosecond | ( | const struct ClockTime *const | self | ) |
Get the nanosecond component of a ClockTime (less than 10^9, the number of nanoseconds in a second).
| double ClockTime_second_decimal | ( | const struct ClockTime *const | self | ) |
Get the second component of a ClockTime as a decimal, based on both the second and nanosecond components.
Compare two ClockTime instances.
| present_bool ClockTime_equal | ( | const struct ClockTime *const | lhs, |
| const struct ClockTime *const | rhs | ||
| ) |
Determine whether two ClockTime instances are equal (lhs == rhs).
| present_bool ClockTime_less_than | ( | const struct ClockTime *const | lhs, |
| const struct ClockTime *const | rhs | ||
| ) |
| present_bool ClockTime_less_than_or_equal | ( | const struct ClockTime *const | lhs, |
| const struct ClockTime *const | rhs | ||
| ) |
| present_bool ClockTime_greater_than | ( | const struct ClockTime *const | lhs, |
| const struct ClockTime *const | rhs | ||
| ) |
| present_bool ClockTime_greater_than_or_equal | ( | const struct ClockTime *const | lhs, |
| const struct ClockTime *const | rhs | ||
| ) |