1559
#define peel_to_type(name, namelen, obj, type) \
1560
repo_peel_to_type(the_repository, name, namelen, obj, type)
1561
1562
-enum date_mode_type {
1563
- DATE_NORMAL = 0,
1564
- DATE_HUMAN,
1565
- DATE_RELATIVE,
1566
- DATE_SHORT,
1567
- DATE_ISO8601,
1568
- DATE_ISO8601_STRICT,
1569
- DATE_RFC2822,
1570
- DATE_STRFTIME,
1571
- DATE_RAW,
1572
- DATE_UNIX
1573
-};
1574
-
1575
-struct date_mode {
1576
- enum date_mode_type type;
1577
- const char *strftime_fmt;
1578
- int local;
1579
-};
1580
-
1581
-/*
1582
- * Convenience helper for passing a constant type, like:
1583
- *
1584
- * show_date(t, tz, DATE_MODE(NORMAL));
1585
- */
1586
-#define DATE_MODE(t) date_mode_from_type(DATE_##t)
1587
-struct date_mode *date_mode_from_type(enum date_mode_type type);
1588
-
1589
-const char *show_date(timestamp_t time, int timezone, const struct date_mode *mode);
1590
-void show_date_relative(timestamp_t time, struct strbuf *timebuf);
1591
-int parse_date(const char *date, struct strbuf *out);
1592
-int parse_date_basic(const char *date, timestamp_t *timestamp, int *offset);
1593
-int parse_expiry_date(const char *date, timestamp_t *timestamp);
1594
-void datestamp(struct strbuf *out);
1595
-#define approxidate(s) approxidate_careful((s), NULL)
1596
-timestamp_t approxidate_careful(const char *, int *);
1597
-timestamp_t approxidate_relative(const char *date);
1598
-void parse_date_format(const char *format, struct date_mode *mode);
1599
-int date_overflows(timestamp_t date);
1600
-time_t tm_to_time_t(const struct tm *tm);
1601
-
1562
#define IDENT_STRICT 1
1563
#define IDENT_NO_DATE 2
1564
#define IDENT_NO_NAME 4
1604
*/
1605
int split_ident_line(struct ident_split *, const char *, int);
1606
1647
-/*
1648
- * Like show_date, but pull the timestamp and tz parameters from
1649
- * the ident_split. It will also sanity-check the values and produce
1650
- * a well-known sentinel date if they appear bogus.
1651
- */
1652
-const char *show_ident_date(const struct ident_split *id,
1653
- const struct date_mode *mode);
1654
-
1607
/*
1608
* Compare split idents for equality or strict ordering. Note that we
1609
* compare only the ident part of the line, ignoring any timestamp.