Fix bug #44 - [Request] IP log in the memory

This commit is contained in:
Jan Vidar Krey
2009-07-26 06:03:43 +02:00
parent b125ffe3c1
commit 444f991f44
8 changed files with 99 additions and 6 deletions

View File

@@ -361,3 +361,10 @@ int split_string(const char* string, const char* split, struct linked_list* list
return n;
}
const char* get_timestamp(time_t now)
{
static char ts[32] = {0, };
struct tm* t = localtime(&now);
sprintf(ts, "[%02d:%02d]", t->tm_hour, t->tm_min);
return ts;
}

View File

@@ -22,6 +22,8 @@
typedef int (*file_line_handler_t)(char* line, int line_number, void* data);
extern const char* get_timestamp(time_t time);
extern int is_num(char c);
extern int is_space(char c);
extern int is_white_space(char c);