36 lines
661 B
C
36 lines
661 B
C
/*
|
|
* Copyright 2015 (c) Anna Schumaker.
|
|
*/
|
|
#ifndef OCARINA_CORE_DATE_H
|
|
#define OCARINA_CORE_DATE_H
|
|
|
|
#include <core/file.h>
|
|
|
|
|
|
struct date {
|
|
unsigned int d_year;
|
|
unsigned int d_month;
|
|
unsigned int d_day;
|
|
};
|
|
|
|
|
|
/* Set the provided date structure to today's date. */
|
|
void date_today(struct date *);
|
|
|
|
/* Read the date from file. */
|
|
void date_read(struct file *, struct date *);
|
|
|
|
/* Write the date to file. */
|
|
void date_write(struct file *, struct date *);
|
|
|
|
/*
|
|
* Compare two dates.
|
|
*
|
|
* if ret < 0: lhs < rhs.
|
|
* if ret = 0: lhs == rhs.
|
|
* if ret > 0: lhs > rhs.
|
|
*/
|
|
int date_compare(const struct date *, const struct date *);
|
|
|
|
#endif /* OCARINA_CORE_DATE_H */
|