Changeset 0071c88
- Timestamp:
- Aug 1, 2011, 11:28:43 PM (12 years ago)
- Children:
- 2e42098
- Parents:
- 9078f69
- git-author:
- David Benjamin <davidben@mit.edu> (08/01/11 02:03:32)
- git-committer:
- David Benjamin <davidben@mit.edu> (08/01/11 23:28:43)
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
rb9517cf r0071c88 1229 1229 now = time(NULL); 1230 1230 1231 tmpbuff = owl_util_ time_to_timestr(localtime(&now));1231 tmpbuff = owl_util_format_time(localtime(&now)); 1232 1232 fprintf(file, "[%d - %s - %lds]: ", 1233 1233 (int) getpid(), tmpbuff, now - owl_global_get_starttime(&g)); … … 1379 1379 owl_fmtext fm, attrfm; 1380 1380 const owl_view *v; 1381 char *time; 1381 1382 #ifdef HAVE_LIBZEPHYR 1382 1383 const ZNotice_t *n; … … 1409 1410 } 1410 1411 1411 owl_fmtext_appendf_normal(&fm, " Time : %s\n", owl_message_get_timestr(m)); 1412 time = owl_message_format_time(m); 1413 owl_fmtext_appendf_normal(&fm, " Time : %s\n", time); 1414 g_free(time); 1412 1415 1413 1416 if (!owl_message_is_type_admin(m)) { … … 1782 1785 owl_fmtext_append_normal(&fm, "\n"); 1783 1786 1784 tmpbuff = owl_util_ time_to_timestr(localtime(&start));1787 tmpbuff = owl_util_format_time(localtime(&start)); 1785 1788 owl_fmtext_appendf_normal(&fm, " Startup Time: %s\n", tmpbuff); 1786 1789 g_free(tmpbuff); … … 3078 3081 idle=owl_buddy_get_idle_time(b); 3079 3082 if (idle!=0) { 3080 timestr=owl_util_ minutes_to_timestr(idle);3083 timestr=owl_util_format_minutes(idle); 3081 3084 } else { 3082 3085 timestr=g_strdup(""); … … 3407 3410 3408 3411 now = time(NULL); 3409 date = owl_util_ time_to_timestr(localtime(&now));3412 date = owl_util_format_time(localtime(&now)); 3410 3413 3411 3414 buff = g_strdup_printf("%s %s", date, string); -
message.c
rb9517cf r0071c88 43 43 /* save the time */ 44 44 m->time = time(NULL); 45 m->timestr = owl_util_time_to_timestr(localtime(&m->time)); 45 m->timestr = g_strdup(ctime(&m->time)); 46 m->timestr[strlen(m->timestr)-1] = '\0'; 46 47 47 48 m->fmtext = NULL; … … 344 345 if (m->timestr) return(m->timestr); 345 346 return(""); 347 } 348 349 CALLER_OWN char *owl_message_format_time(const owl_message *m) 350 { 351 return owl_util_format_time(localtime(&m->time)); 346 352 } 347 353 … … 793 799 if (m->timestr) g_free(m->timestr); 794 800 m->time = n->z_time.tv_sec; 795 m->timestr = owl_util_time_to_timestr(localtime(&m->time)); 801 m->timestr = g_strdup(ctime(&m->time)); 802 m->timestr[strlen(m->timestr)-1] = '\0'; 796 803 797 804 /* set other info */ -
util.c
rf271129 r0071c88 268 268 269 269 /* caller must free the return */ 270 CALLER_OWN char *owl_util_ minutes_to_timestr(int in)270 CALLER_OWN char *owl_util_format_minutes(int in) 271 271 { 272 272 int days, hours; … … 289 289 } 290 290 291 CALLER_OWN char *owl_util_ time_to_timestr(const struct tm *time)291 CALLER_OWN char *owl_util_format_time(const struct tm *time) 292 292 { 293 293 /* 32 chosen for first attempt because timestr will end up being
Note: See TracChangeset
for help on using the changeset viewer.