]> git.notmuchmail.org Git - notmuch/blobdiff - date.c
Hook up our fancy new notmuch_parse_date function.
[notmuch] / date.c
diff --git a/date.c b/date.c
index ff1e1a6ac7671f2e88670ea866fd56db6a7af672..c116bbd5f432f54dfa41b6aa991a0caccdd0b972 100644 (file)
--- a/date.c
+++ b/date.c
@@ -27,6 +27,8 @@
 
 #include <time.h>
 
+#include <glib.h> /* For g_ascii_strncasecmp only. */
+
 #ifndef FALSE
 #define FALSE 0
 #endif
@@ -638,30 +640,20 @@ gmime_datetok_table_init (void)
 }
 #endif
 
-
-/**
- * g_mime_utils_header_decode_date:
- * @str: input date string
- * @tz_offset: timezone offset
- *
- * Decodes the rfc822 date string and saves the GMT offset into
- * @tz_offset if non-NULL.
- *
- * Returns: the time_t representation of the date string specified by
- * @str or (time_t) %0 on error. If @tz_offset is non-NULL, the value
- * of the timezone offset will be stored.
- **/
 time_t
-g_mime_utils_header_decode_date (const char *str, int *tz_offset)
+notmuch_parse_date (const char *str, int *tz_offset)
 {
        date_token *token, *tokens;
        time_t date;
-       
+
+       if (str == NULL)
+               return 0;
+
        if (!(tokens = datetok (str))) {
                if (tz_offset)
                        *tz_offset = 0;
                
-               return (time_t) 0;
+               return 0;
        }
        
        if (!(date = parse_rfc822_date (tokens, tz_offset)))