| 536 | #define CTIME_BUFFER_SIZE 26 |
| 537 | |
| 538 | static int pv_get_timef(struct sip_msg *msg, pv_param_t *param, |
| 539 | pv_value_t *res) |
| 540 | { |
| 541 | static char ctime_bufs[CTIME_BUFFER_NO][CTIME_BUFFER_SIZE]; |
| 542 | static char *buf; |
| 543 | static int ctime_buf_no = 0; |
| 544 | time_t t; |
| 545 | str s; |
| 546 | |
| 547 | if(msg==NULL) |
| 548 | return -1; |
| 549 | |
| 550 | t = time(NULL); |
| 551 | buf = ctime_bufs[ctime_buf_no]; |
| 552 | ctime_buf_no = (ctime_buf_no + 1) % CTIME_BUFFER_NO; |
| 553 | s.s = ctime_r(&t, buf); |
| 554 | s.len = strlen(s.s)-1; |
| 555 | return pv_get_strintval(msg, param, res, &s, (int)t); |
| 556 | } |
| 557 | |
| 558 | static int pv_get_msgid(struct sip_msg *msg, pv_param_t *param, |
| 559 | pv_value_t *res) |
nothing calls this directly
no test coverage detected