comparison nnchat.c @ 397:932829a556c7

Rename a function.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 24 May 2012 04:59:49 +0300
parents a2b7ac328e62
children c345a8efb1d4
comparison
equal deleted inserted replaced
396:07a46ca075ab 397:932829a556c7
202 } 202 }
203 203
204 return TRUE; 204 return TRUE;
205 } 205 }
206 206
207 BOOL getTimeStamp(char *str, size_t len, const char *fmt) 207 BOOL str_get_timestamp(char *str, size_t len, const char *fmt)
208 { 208 {
209 time_t stamp = time(NULL); 209 time_t stamp = time(NULL);
210 struct tm *stamp_tm; 210 struct tm *stamp_tm;
211 if ((stamp_tm = localtime(&stamp)) != NULL) 211 if ((stamp_tm = localtime(&stamp)) != NULL)
212 { 212 {
279 char tmpStr[128]; 279 char tmpStr[128];
280 int i; 280 int i;
281 281
282 if (statusWin == NULL) return; 282 if (statusWin == NULL) return;
283 283
284 getTimeStamp(tmpStr, sizeof(tmpStr), "%H:%M:%S"); 284 str_get_timestamp(tmpStr, sizeof(tmpStr), "%H:%M:%S");
285 285
286 wbkgdset(statusWin, COLOR_PAIR(10)); 286 wbkgdset(statusWin, COLOR_PAIR(10));
287 werase(statusWin); 287 werase(statusWin);
288 288
289 wattrset(statusWin, A_BOLD | COLOR_PAIR(11)); 289 wattrset(statusWin, A_BOLD | COLOR_PAIR(11));
519 519
520 void printMsgV(nn_window_t *win, int flags, const char *fmt, va_list ap) 520 void printMsgV(nn_window_t *win, int flags, const char *fmt, va_list ap)
521 { 521 {
522 char tmpStr[128], *buf; 522 char tmpStr[128], *buf;
523 523
524 getTimeStamp(tmpStr, sizeof(tmpStr), "½17½[½11½%H:%M:%S½17½]½0½ "); 524 str_get_timestamp(tmpStr, sizeof(tmpStr), "½17½[½11½%H:%M:%S½17½]½0½ ");
525 525
526 buf = th_strdup_vprintf(fmt, ap); 526 buf = th_strdup_vprintf(fmt, ap);
527 527
528 if (optLogFile && (flags & LOG_FILE)) 528 if (optLogFile && (flags & LOG_FILE))
529 { 529 {
738 th_free(s); 738 th_free(s);
739 th_free(userName); 739 th_free(userName);
740 return 0; 740 return 0;
741 } 741 }
742 742
743 str_get_timestamp(tmpStr, sizeof(tmpStr), "%c");
743 744
744 int handleLogin(nn_conn_t *conn, const char *str) 745 int handleLogin(nn_conn_t *conn, const char *str)
745 { 746 {
746 char tmpStr[256]; 747 char tmpStr[256];
747 748