Changeset 56b308e in mainline for uspace/lib/c


Ignore:
Timestamp:
2012-04-23T22:28:57Z (13 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d3e3a71
Parents:
f6cb995
Message:

libc: move ctime() from libposix to libc

Location:
uspace/lib/c
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/time.c

    rf6cb995 r56b308e  
    861861}
    862862
     863/**
     864 * Equivalent to asctime(localtime(clock)).
     865 *
     866 * @param timer Time to convert.
     867 * @return Pointer to a statically allocated string holding the date.
     868 */
     869char *ctime(const time_t *timer)
     870{
     871        struct tm *loctime = localtime(timer);
     872        if (loctime == NULL) {
     873                return NULL;
     874        }
     875        return asctime(loctime);
     876}
     877
    863878/** @}
    864879 */
  • uspace/lib/c/include/sys/time.h

    rf6cb995 r56b308e  
    8383extern char *asctime(const struct tm *timeptr);
    8484extern struct tm *localtime(const time_t *timer);
     85extern char *ctime(const time_t *timer);
    8586extern size_t strftime(char *restrict s, size_t maxsize,
    8687    const char *restrict format, const struct tm *restrict tm);
Note: See TracChangeset for help on using the changeset viewer.