1 Return-Path: <jani@nikula.org>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 7D651431FB6
\r
6 for <notmuch@notmuchmail.org>; Sun, 16 Dec 2012 13:02:53 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"
\r
12 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
13 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id oXmgE6FzWfTq for <notmuch@notmuchmail.org>;
\r
17 Sun, 16 Dec 2012 13:02:53 -0800 (PST)
\r
18 Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com
\r
19 [209.85.217.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id D7305431FAE
\r
22 for <notmuch@notmuchmail.org>; Sun, 16 Dec 2012 13:02:52 -0800 (PST)
\r
23 Received: by mail-lb0-f181.google.com with SMTP id ge1so4052259lbb.26
\r
24 for <notmuch@notmuchmail.org>; Sun, 16 Dec 2012 13:02:51 -0800 (PST)
\r
25 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
26 d=google.com; s=20120113;
\r
27 h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references
\r
28 :in-reply-to:references:x-gm-message-state;
\r
29 bh=yB+hA6dX1WwjVFKH/ANzufa8mVAszdN9OyGxjSv9O74=;
\r
30 b=ilJTteV8uzHoWtpoCUOBaVdk9xM3m8JKn4TA3mD7vmOnNYOGBbbDHxHyN6O2Zcj4C8
\r
31 XQfC58hX/ckE2jIH+yFOIuCqh/2KrslXxsE221B1N9TD/AFk1TFN2BBPKTm7zn3QnQc6
\r
32 NoVlE+eVYjxy2730zgxYgnvc01sBqWO4AO/M8vQdCpNtWyfgMZN3u7mBmhMMa9XfqUOU
\r
33 w1odtTu1ghfkyxRAesOfvKaRHziZ/a4qQ6nRd4EGSqcGIk2/EOkeWBnel1UCUsJqx/Pa
\r
34 736sBwfeVv4N9//jX2ZOaYpM0Mq5ue5ldhlfIy1PedNA9ddbkqRUfHHWrIcjlUfnxkJA
\r
36 Received: by 10.152.108.172 with SMTP id hl12mr8769618lab.32.1355691771471;
\r
37 Sun, 16 Dec 2012 13:02:51 -0800 (PST)
\r
38 Received: from localhost (dsl-hkibrasgw4-50df51-27.dhcp.inet.fi.
\r
40 by mx.google.com with ESMTPS id gr12sm4074841lab.3.2012.12.16.13.02.49
\r
41 (version=SSLv3 cipher=OTHER); Sun, 16 Dec 2012 13:02:50 -0800 (PST)
\r
42 From: Jani Nikula <jani@nikula.org>
\r
43 To: notmuch@notmuchmail.org
\r
44 Subject: [PATCH v3 2/5] sprinter: add text0 formatter for null character
\r
46 Date: Sun, 16 Dec 2012 23:02:38 +0200
\r
48 <5549df295eceb2aa388c0a4c3218dfb43fa13820.1355691124.git.jani@nikula.org>
\r
49 X-Mailer: git-send-email 1.7.10.4
\r
50 In-Reply-To: <cover.1355691124.git.jani@nikula.org>
\r
51 References: <cover.1355691124.git.jani@nikula.org>
\r
52 In-Reply-To: <cover.1355691124.git.jani@nikula.org>
\r
53 References: <cover.1355691124.git.jani@nikula.org>
\r
55 ALoCoQlnhRufUKhDMuibpv4dbMYW5ManNu05dliorW3SWjq/4eMC61mWmBfpXnre2VOYmQ3m4stP
\r
56 X-BeenThere: notmuch@notmuchmail.org
\r
57 X-Mailman-Version: 2.1.13
\r
59 List-Id: "Use and development of the notmuch mail system."
\r
60 <notmuch.notmuchmail.org>
\r
61 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
62 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
63 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
64 List-Post: <mailto:notmuch@notmuchmail.org>
\r
65 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
66 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
67 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
68 X-List-Received-Date: Sun, 16 Dec 2012 21:02:53 -0000
\r
70 Same as the text formatter, but with each field separated by a null
\r
71 character rather than a newline character.
\r
73 sprinter-text.c | 22 ++++++++++++++++++++++
\r
74 sprinter.h | 6 ++++++
\r
75 2 files changed, 28 insertions(+)
\r
77 diff --git a/sprinter-text.c b/sprinter-text.c
\r
78 index 10343be..7779488 100644
\r
79 --- a/sprinter-text.c
\r
80 +++ b/sprinter-text.c
\r
81 @@ -68,6 +68,14 @@ text_separator (struct sprinter *sp)
\r
85 +text0_separator (struct sprinter *sp)
\r
87 + struct sprinter_text *sptxt = (struct sprinter_text *) sp;
\r
89 + fputc ('\0', sptxt->stream);
\r
93 text_set_prefix (struct sprinter *sp, const char *prefix)
\r
95 struct sprinter_text *sptxt = (struct sprinter_text *) sp;
\r
96 @@ -133,3 +141,17 @@ sprinter_text_create (const void *ctx, FILE *stream)
\r
97 res->stream = stream;
\r
98 return &res->vtable;
\r
102 +sprinter_text0_create (const void *ctx, FILE *stream)
\r
104 + struct sprinter *sp;
\r
106 + sp = sprinter_text_create (ctx, stream);
\r
110 + sp->separator = text0_separator;
\r
114 diff --git a/sprinter.h b/sprinter.h
\r
115 index f43a844..f859672 100644
\r
118 @@ -67,6 +67,12 @@ typedef struct sprinter {
\r
120 sprinter_text_create (const void *ctx, FILE *stream);
\r
122 +/* Create a new unstructured printer that emits the text format for
\r
123 + * "notmuch search", with each field separated by a null character
\r
124 + * instead of the newline character. */
\r
126 +sprinter_text0_create (const void *ctx, FILE *stream);
\r
128 /* Create a new structure printer that emits JSON. */
\r
130 sprinter_json_create (const void *ctx, FILE *stream);
\r