unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Sebastian Spaeth <Sebastian@SSpaeth.de>
To: notmuch@notmuchmail.org
Subject: [PATCH 2/4] Introduce new notmuch return status NOTMUCH_STATUS_INVALID_DATE
Date: Mon,  8 Feb 2010 12:14:10 +0100	[thread overview]
Message-ID: <1265627652-25912-2-git-send-email-Sebastian@SSpaeth.de> (raw)
In-Reply-To: <1265627652-25912-1-git-send-email-Sebastian@SSpaeth.de>

This is not used yet in this commit but will be the return value in case the date parser gets handed invalid dates.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
---
 lib/database.cc |    2 ++
 lib/notmuch.h   |    3 +++
 notmuch-new.c   |    1 +
 3 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/lib/database.cc b/lib/database.cc
index cce7847..ddda933 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -219,6 +219,8 @@ notmuch_status_to_string (notmuch_status_t status)
 	return "Erroneous NULL pointer";
     case NOTMUCH_STATUS_TAG_TOO_LONG:
 	return "Tag value is too long (exceeds NOTMUCH_TAG_MAX)";
+    case NOTMUCH_STATUS_INVALID_DATE:
+	return "Date value did not parse to a valid date";
     case NOTMUCH_STATUS_UNBALANCED_FREEZE_THAW:
 	return "Unbalanced number of calls to notmuch_message_freeze/thaw";
     default:
diff --git a/lib/notmuch.h b/lib/notmuch.h
index d3e50a7..56a76d1 100644
--- a/lib/notmuch.h
+++ b/lib/notmuch.h
@@ -78,6 +78,8 @@ typedef int notmuch_bool_t;
  * NOTMUCH_STATUS_TAG_TOO_LONG: A tag value is too long (exceeds
  *	NOTMUCH_TAG_MAX)
  *
+ * NOTMUCH_STATUS_INVALID_DATE: Date parsing failed
+ *
  * NOTMUCH_STATUS_UNBALANCED_FREEZE_THAW: The notmuch_message_thaw
  *	function has been called more times than notmuch_message_freeze.
  *
@@ -96,6 +98,7 @@ typedef enum _notmuch_status {
     NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID,
     NOTMUCH_STATUS_NULL_POINTER,
     NOTMUCH_STATUS_TAG_TOO_LONG,
+    NOTMUCH_STATUS_INVALID_DATE,
     NOTMUCH_STATUS_UNBALANCED_FREEZE_THAW,
 
     NOTMUCH_STATUS_LAST_STATUS
diff --git a/notmuch-new.c b/notmuch-new.c
index f25c71f..5da31c1 100644
--- a/notmuch-new.c
+++ b/notmuch-new.c
@@ -431,6 +431,7 @@ add_files_recursive (notmuch_database_t *notmuch,
 	    ret = status;
 	    goto DONE;
 	default:
+	case NOTMUCH_STATUS_INVALID_DATE:
 	case NOTMUCH_STATUS_FILE_ERROR:
 	case NOTMUCH_STATUS_NULL_POINTER:
 	case NOTMUCH_STATUS_TAG_TOO_LONG:
-- 
1.6.3.3

  reply	other threads:[~2010-02-08 11:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-08  9:41 date parser branch updated and rebased Sebastian Spaeth
2010-02-08 11:14 ` [PATCH 1/4] add date parser file from Keith Sebastian Spaeth
2010-02-08 11:14   ` Sebastian Spaeth [this message]
2010-02-08 11:14     ` [PATCH 3/4] integrate date parser Sebastian Spaeth
2010-02-08 11:14       ` [PATCH 4/4] add documentation for the new daterange parser and remove TODO list item Sebastian Spaeth
2010-02-08 12:57         ` [PATCH] notmuch-test: add tests for counting within absolute time ranges and 'today' Sebastian Spaeth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1265627652-25912-2-git-send-email-Sebastian@SSpaeth.de \
    --to=sebastian@sspaeth.de \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).