Patchworkβ [2/4] Introduce new notmuch return status NOTMUCH_STATUS_INVALID_DATE

login
register
about
Submitter Sebastian Spaeth
Date 2010-02-08 11:14:10
Message ID <1265627652-25912-2-git-send-email-Sebastian@SSpaeth.de>
Download mbox | patch
Permalink /patch/339/
State New
Headers show

Comments

Sebastian Spaeth - 2010-02-08 11:14:10
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(-)

Patch

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: