aboutsummaryrefslogtreecommitdiffhomepage
path: root/date.c
Commit message (Collapse)AuthorAge
* Hook up our fancy new notmuch_parse_date function.Gravatar Carl Worth2009-10-19
| | | | | With all the de-glib-ification out of the way, we can now use it to allow for date-based sorting of Xapian search results.
* notmuch_parse_date: Handle a NULL date string gracefully.Gravatar Carl Worth2009-10-19
| | | | | The obvious thing to do is to treat a missing date as the beginning of time. Also, remove a useless cast from another return of 0.
* date.c: Rename function to notmuch_parse_dateGravatar Carl Worth2009-10-19
| | | | | | | Now completing the process of making this function "our own". The documentation is deleted here, because we already have the documentation we want in notmuch-private.h.
* date.c: Add hard-coded definition of HAVE_TIMEZONEGravatar Carl Worth2009-10-19
| | | | | | | | | | | | The original code expected this to be set by running configure. We'll just manually set it here for now. This isn't as portable as if we were doing some compile-time examination of the current system, but I don't need portability now. When someone comes along that wants to port notmuch to another system, they will already have all the #ifdefs in place and will simply need to add the appropriate machinery to set the defines.
* date.c: Don't use glib's slice allocator.Gravatar Carl Worth2009-10-19
| | | | | | | | | | | | | | | | | | | | This change is gratuitous. For now, notmuch is still linking against glib, so I don't have any requirement to remove this, (unlike the last few changes where good taste really did require the changes). The motivation here is two-fold: 1. I'm considering switching away from all glib-based allocation soon so that I can more easily verify that the memory management is solid. I want valgrind to say "no leaks are possible" not "there is tons of memory still allocated, but probably reachable so who knows if there are leaks or not?". And glib seems to make that impossible. 2. I don't think there's anything performance-sensitive about the allocation here. (In fact, if there is, then the right answer would be to do this parsing without any allocation whatsoever.)
* date.c: Remove occurrences of gboolean.Gravatar Carl Worth2009-10-19
| | | | | | | | | | While this is surely one of the most innocent typedefs, it still annoys me to have basic types like 'int' re-defined like this. It just makes it harder to copy the code between projects, with very little benefit in readability. For readability, predicate functions and variables should be obviously Boolean-natured by their actual *names*.
* date.c: Remove all occurrences of g_return_val_if_failGravatar Carl Worth2009-10-19
| | | | | | | | | | | That's got to be one of the hardest macro names to read, ever, (it's phrased with an implicit negative in the condition, rather than something simple like "assert"). Plus, it's evil, since it's a macro with a return in it. And finally, it's actually *longer* than just typing "if" and "return". So what's the point of this ugly idiom?
* date.c: Keep the comments clean.Gravatar Carl Worth2009-10-19
| | | | | Never know when the children might be reading over my shoulder, for example. :-)
* date.c: Change headers/defines t owork within notmuch.Gravatar Carl Worth2009-10-19
| | | | | | We can't rely on any gmime-internal headers, (and fortunately we don't need to). We also aren't burdened with any autconf machinery so don't reference any of that.
* date.c: Remove a bunch of undesired code.Gravatar Carl Worth2009-10-19
| | | | We're only interested in the date-parsing code here.
* date.c: Convert from LGPL-2+ to GPL-3+Gravatar Carl Worth2009-10-19
| | | | As authorized by LGPL-2 term (3).
* date.c: Add new file directly from gmime2.4-2.4.6/gmime/gmime-utils.cGravatar Carl Worth2009-10-19
We're sucking in one gmime implementation file just to get the piece that parses an RFC 822 date, because I don't want to go through the pain of replicating that.