Changeset 664fc031 in mainline


Ignore:
Timestamp:
2012-08-22T18:53:13Z (12 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2e6293b
Parents:
077dad2
Message:

rename the new time functions to the time_* naming scheme

Location:
uspace
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/time/cmos-rtc/cmos-rtc.c

    r077dad2 r664fc031  
    312312                fibril_mutex_unlock(&rtc->mutex);
    313313
    314                 return localtime2tm(cur_time, t);
     314                return time_local2tm(cur_time, t);
    315315        }
    316316
  • uspace/lib/c/generic/time.c

    r077dad2 r664fc031  
    849849 * @return        EOK or a negative error code
    850850 */
    851 int utctime2tm(const time_t time, struct tm *restrict result)
     851int time_utc2tm(const time_t time, struct tm *restrict result)
    852852{
    853853        assert(result != NULL);
     
    876876 * @return       EOK or a negative error code.
    877877 */
    878 int utctime2str(const time_t time, char *restrict buf)
     878int time_utc2str(const time_t time, char *restrict buf)
    879879{
    880880        struct tm t;
    881881        int r;
    882882
    883         if ((r = utctime2tm(time, &t)) != EOK)
     883        if ((r = time_utc2tm(time, &t)) != EOK)
    884884                return r;
    885885
    886         tm2str(&t, buf);
     886        time_tm2str(&t, buf);
    887887        return EOK;
    888888}
     
    897897 *                bytes long.
    898898 */
    899 void tm2str(const struct tm *restrict timeptr, char *restrict buf)
     899void time_tm2str(const struct tm *restrict timeptr, char *restrict buf)
    900900{
    901901        assert(timeptr != NULL);
     
    927927 * @return          EOK on success or a negative error code.
    928928 */
    929 int localtime2tm(const time_t time, struct tm *restrict result)
     929int time_local2tm(const time_t time, struct tm *restrict result)
    930930{
    931931        // TODO: deal with timezone
     
    957957 * @return       EOK on success or a negative error code.
    958958 */
    959 int localtime2str(const time_t time, char *buf)
     959int time_local2str(const time_t time, char *buf)
    960960{
    961961        struct tm loctime;
    962962        int r;
    963963
    964         if ((r = localtime2tm(time, &loctime)) != EOK)
     964        if ((r = time_local2tm(time, &loctime)) != EOK)
    965965                return r;
    966966
    967         tm2str(&loctime, buf);
     967        time_tm2str(&loctime, buf);
    968968
    969969        return EOK;
  • uspace/lib/c/include/sys/time.h

    r077dad2 r664fc031  
    8181
    8282extern time_t mktime(struct tm *tm);
    83 extern int utctime2tm(const time_t time, struct tm *result);
    84 extern int utctime2str(const time_t time, char *buf);
    85 extern void tm2str(const struct tm *timeptr, char *buf);
    86 extern int localtime2tm(const time_t time, struct tm *result);
    87 extern int localtime2str(const time_t time, char *buf);
     83extern int time_utc2tm(const time_t time, struct tm *result);
     84extern int time_utc2str(const time_t time, char *buf);
     85extern void time_tm2str(const struct tm *timeptr, char *buf);
     86extern int time_local2tm(const time_t time, struct tm *result);
     87extern int time_local2str(const time_t time, char *buf);
    8888extern double difftime(time_t time1, time_t time0);
    8989extern size_t strftime(char *restrict s, size_t maxsize,
  • uspace/lib/posix/time.c

    r077dad2 r664fc031  
    8787    struct tm *restrict result)
    8888{
    89         int rc = utctime2tm(*timer, result);
     89        int rc = time_utc2tm(*timer, result);
    9090        if (rc != EOK) {
    9191                errno = rc;
     
    153153    char *restrict buf)
    154154{
    155         tm2str(timeptr, buf);
     155        time_tm2str(timeptr, buf);
    156156        return buf;
    157157}
     
    184184char *posix_ctime_r(const time_t *timer, char *buf)
    185185{
    186         int r = localtime2str(*timer, buf);
     186        int r = time_local2str(*timer, buf);
    187187        if (r != EOK) {
    188188                errno = r;
Note: See TracChangeset for help on using the changeset viewer.