Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id B8FF5431FAE for ; Mon, 8 Feb 2010 03:14:17 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.272 X-Spam-Level: X-Spam-Status: No, score=-0.272 tagged_above=-999 required=5 tests=[AWL=-0.273, BAYES_50=0.001] autolearn=ham Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id avlGwGEzl7YS for ; Mon, 8 Feb 2010 03:14:17 -0800 (PST) Received: from homiemail-a11.g.dreamhost.com (caiajhbdccac.dreamhost.com [208.97.132.202]) by olra.theworths.org (Postfix) with ESMTP id 0B474431FBC for ; Mon, 8 Feb 2010 03:14:17 -0800 (PST) Received: from localhost.localdomain (mtec-hg-docking-1-dhcp-204.ethz.ch [129.132.133.204]) by homiemail-a11.g.dreamhost.com (Postfix) with ESMTPA id E6C5E19406D; Mon, 8 Feb 2010 03:14:15 -0800 (PST) From: Sebastian Spaeth To: notmuch@notmuchmail.org Date: Mon, 8 Feb 2010 12:14:10 +0100 Message-Id: <1265627652-25912-2-git-send-email-Sebastian@SSpaeth.de> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1265627652-25912-1-git-send-email-Sebastian@SSpaeth.de> References: <87fx5cjc83.fsf@SSpaeth.de> <1265627652-25912-1-git-send-email-Sebastian@SSpaeth.de> Subject: [notmuch] [PATCH 2/4] Introduce new notmuch return status NOTMUCH_STATUS_INVALID_DATE X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 11:14:17 -0000 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 --- 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