Changeset 664fc031 in mainline
- Timestamp:
- 2012-08-22T18:53:13Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2e6293b
- Parents:
- 077dad2
- Location:
- uspace
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/time/cmos-rtc/cmos-rtc.c
r077dad2 r664fc031 312 312 fibril_mutex_unlock(&rtc->mutex); 313 313 314 return localtime2tm(cur_time, t);314 return time_local2tm(cur_time, t); 315 315 } 316 316 -
uspace/lib/c/generic/time.c
r077dad2 r664fc031 849 849 * @return EOK or a negative error code 850 850 */ 851 int utctime2tm(const time_t time, struct tm *restrict result)851 int time_utc2tm(const time_t time, struct tm *restrict result) 852 852 { 853 853 assert(result != NULL); … … 876 876 * @return EOK or a negative error code. 877 877 */ 878 int utctime2str(const time_t time, char *restrict buf)878 int time_utc2str(const time_t time, char *restrict buf) 879 879 { 880 880 struct tm t; 881 881 int r; 882 882 883 if ((r = utctime2tm(time, &t)) != EOK)883 if ((r = time_utc2tm(time, &t)) != EOK) 884 884 return r; 885 885 886 t m2str(&t, buf);886 time_tm2str(&t, buf); 887 887 return EOK; 888 888 } … … 897 897 * bytes long. 898 898 */ 899 void t m2str(const struct tm *restrict timeptr, char *restrict buf)899 void time_tm2str(const struct tm *restrict timeptr, char *restrict buf) 900 900 { 901 901 assert(timeptr != NULL); … … 927 927 * @return EOK on success or a negative error code. 928 928 */ 929 int localtime2tm(const time_t time, struct tm *restrict result)929 int time_local2tm(const time_t time, struct tm *restrict result) 930 930 { 931 931 // TODO: deal with timezone … … 957 957 * @return EOK on success or a negative error code. 958 958 */ 959 int localtime2str(const time_t time, char *buf)959 int time_local2str(const time_t time, char *buf) 960 960 { 961 961 struct tm loctime; 962 962 int r; 963 963 964 if ((r = localtime2tm(time, &loctime)) != EOK)964 if ((r = time_local2tm(time, &loctime)) != EOK) 965 965 return r; 966 966 967 t m2str(&loctime, buf);967 time_tm2str(&loctime, buf); 968 968 969 969 return EOK; -
uspace/lib/c/include/sys/time.h
r077dad2 r664fc031 81 81 82 82 extern 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 t m2str(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);83 extern int time_utc2tm(const time_t time, struct tm *result); 84 extern int time_utc2str(const time_t time, char *buf); 85 extern void time_tm2str(const struct tm *timeptr, char *buf); 86 extern int time_local2tm(const time_t time, struct tm *result); 87 extern int time_local2str(const time_t time, char *buf); 88 88 extern double difftime(time_t time1, time_t time0); 89 89 extern size_t strftime(char *restrict s, size_t maxsize, -
uspace/lib/posix/time.c
r077dad2 r664fc031 87 87 struct tm *restrict result) 88 88 { 89 int rc = utctime2tm(*timer, result);89 int rc = time_utc2tm(*timer, result); 90 90 if (rc != EOK) { 91 91 errno = rc; … … 153 153 char *restrict buf) 154 154 { 155 t m2str(timeptr, buf);155 time_tm2str(timeptr, buf); 156 156 return buf; 157 157 } … … 184 184 char *posix_ctime_r(const time_t *timer, char *buf) 185 185 { 186 int r = localtime2str(*timer, buf);186 int r = time_local2str(*timer, buf); 187 187 if (r != EOK) { 188 188 errno = r;
Note:
See TracChangeset
for help on using the changeset viewer.