Ignore:
Timestamp:
09/30/13 03:39:55 (11 years ago)
Author:
atzm
Message:

parse syslog datetime

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ksyslog/trunk/ksyslog.h

    r232 r235  
    5252struct ksyslog_entry { 
    5353        struct list_head list; 
     54        struct timeval tv; 
    5455 
    55         struct timeval tv; 
     56        unsigned long time; 
     57        unsigned int priority; 
    5658        enum ksyslog_facility facility; 
    5759        enum ksyslog_severity severity; 
     
    123125} 
    124126 
     127static inline __u8 
     128ksyslog_month_num(const char *month) 
     129{ 
     130        if (!memcmp(month, "Jan", 3)) 
     131                return 1; 
     132        else if (!memcmp(month, "Feb", 3)) 
     133                return 2; 
     134        else if (!memcmp(month, "Mar", 3)) 
     135                return 3; 
     136        else if (!memcmp(month, "Apr", 3)) 
     137                return 4; 
     138        else if (!memcmp(month, "May", 3)) 
     139                return 5; 
     140        else if (!memcmp(month, "Jun", 3)) 
     141                return 6; 
     142        else if (!memcmp(month, "Jul", 3)) 
     143                return 7; 
     144        else if (!memcmp(month, "Aug", 3)) 
     145                return 8; 
     146        else if (!memcmp(month, "Sep", 3)) 
     147                return 9; 
     148        else if (!memcmp(month, "Oct", 3)) 
     149                return 10; 
     150        else if (!memcmp(month, "Nov", 3)) 
     151                return 11; 
     152        else if (!memcmp(month, "Dec", 3)) 
     153                return 12; 
     154        else 
     155                return 0; 
     156} 
     157 
    125158#endif 
Note: See TracChangeset for help on using the changeset viewer.