Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/time.h

    rf7ea5400 r9d58539  
    6363#endif
    6464
     65#undef ASCTIME_BUF_LEN
     66#define ASCTIME_BUF_LEN 26
     67
    6568#undef CLOCK_REALTIME
    6669#define CLOCK_REALTIME ((posix_clockid_t) 0)
     70
     71struct posix_tm {
     72        int tm_sec;         /* Seconds [0,60]. */
     73        int tm_min;         /* Minutes [0,59]. */
     74        int tm_hour;        /* Hour [0,23]. */
     75        int tm_mday;        /* Day of month [1,31]. */
     76        int tm_mon;         /* Month of year [0,11]. */
     77        int tm_year;        /* Years since 1900. */
     78        int tm_wday;        /* Day of week [0,6] (Sunday = 0). */
     79        int tm_yday;        /* Day of year [0,365]. */
     80        int tm_isdst;       /* Daylight Savings flag. */
     81};
    6782
    6883struct posix_timespec {
     
    8499extern void posix_tzset(void);
    85100
     101/* Elapsed Time */
     102extern double posix_difftime(time_t time1, time_t time0);
     103
    86104/* Broken-down Time */
    87 extern struct tm *posix_gmtime_r(const time_t *restrict timer,
    88     struct tm *restrict result);
    89 extern struct tm *posix_gmtime(const time_t *restrict timep);
    90 extern struct tm *posix_localtime_r(const time_t *restrict timer,
    91     struct tm *restrict result);
    92 extern struct tm *posix_localtime(const time_t *restrict timep);
     105extern time_t posix_mktime(struct posix_tm *tm);
     106extern struct posix_tm *posix_gmtime(const time_t *timer);
     107extern struct posix_tm *posix_gmtime_r(const time_t *restrict timer,
     108    struct posix_tm *restrict result);
     109extern struct posix_tm *posix_localtime(const time_t *timer);
     110extern struct posix_tm *posix_localtime_r(const time_t *restrict timer,
     111    struct posix_tm *restrict result);
    93112
    94113/* Formatting Calendar Time */
    95 extern char *posix_asctime_r(const struct tm *restrict timeptr,
     114extern char *posix_asctime(const struct posix_tm *timeptr);
     115extern char *posix_asctime_r(const struct posix_tm *restrict timeptr,
    96116    char *restrict buf);
    97 extern char *posix_asctime(const struct tm *restrict timeptr);
     117extern char *posix_ctime(const time_t *timer);
    98118extern char *posix_ctime_r(const time_t *timer, char *buf);
    99 extern char *posix_ctime(const time_t *timer);
     119extern size_t posix_strftime(char *restrict s, size_t maxsize,
     120    const char *restrict format, const struct posix_tm *restrict tm);
    100121
    101122/* Clocks */
     
    113134
    114135#ifndef LIBPOSIX_INTERNAL
    115         #define timespec    posix_timespec
    116         #define itimerspec  posix_itimerspec
    117         #define timer_t     posix_timer_t
     136        #define tm posix_tm
     137        #define timespec posix_timespec
     138        #define itimerspec posix_itimerspec
     139        #define timer_t posix_timer_t
    118140
    119         #define daylight    posix_daylight
    120         #define timezone    posix_timezone
    121         #define tzname      posix_tzname
    122         #define tzset       posix_tzset
     141        #define daylight posix_daylight
     142        #define timezone posix_timezone
     143        #define tzname posix_tzname
     144        #define tzset posix_tzset
    123145
    124         #define gmtime_r    posix_gmtime_r
    125         #define gmtime      posix_gmtime
     146        #define difftime posix_difftime
     147
     148        #define mktime posix_mktime
     149        #define gmtime posix_gmtime
     150        #define gmtime_r posix_gmtime_r
     151        #define localtime posix_localtime
    126152        #define localtime_r posix_localtime_r
    127         #define localtime   posix_localtime
    128153
    129         #define asctime_r   posix_asctime_r
    130         #define asctime     posix_asctime
    131         #define ctime_r     posix_ctime_r
    132         #define ctime       posix_ctime
     154        #define asctime posix_asctime
     155        #define asctime_r posix_asctime_r
     156        #define ctime posix_ctime
     157        #define ctime_r posix_ctime_r
     158        #define strftime posix_strftime
    133159
    134160        #define clock_getres posix_clock_getres
Note: See TracChangeset for help on using the changeset viewer.